docs/multi-tenant/verification-report.md
Date: 2026-07-24
Status: FOUNDATION AND CONTROL PLANE VERIFIED — PRODUCTION ACTIVATION REMAINS GATED
This report records the implementation and verification evidence for one
logical LangBot instance serving multiple Workspace tenants. It covers the
open-source Core, the shared Plugin/Box runtimes, the closed Space adapter, and
the Space Cloud v2 modular-monolith control plane. It does not claim that the
production Cloud deployment may enable CLOUD_V2_ENABLED yet.
feat/multi-tenants, commit
e8a09b7537ef285a967f24add05fdb9bb557b97efeat/multi-tenants, head
ca545d079ca1657a5d4efb4e31bfeafe1a374a46feat/cloud-v2-control-plane, head
ce41ff370e94a405f70e2fbb2f99b0946e0e0387langbot-space/cloud-adapter0.4.18Core pins SDK commit e7d946af4a6b1494fbe74627c1815ace19ac8991;
the SDK branch head adds CI-only follow-up. Cloud v2 is a greenfield
multi-Workspace deployment and does not provision one Pod, database, queue, or
Runtime per tenant. Legacy Space Pods remain a compatibility surface only.
instance_uuid; workspace_uuid is the tenant key.CLOUD_V2_ENABLED defaults to false. Invalid or incomplete configuration
fails startup, and disabled endpoints return 503./cloud page selects a Workspace and shows its independent subscription,
entitlement, limits, and usage. When Cloud v2 is disabled or the backend does
not expose the feature field, the complete legacy Welcome/Pod UI is used.AutoMigrate.(instance, workspace, execution generation, installation, runtime revision, artifact digest).memory.max and swap.max=0.global session for an entitled
Workspace and no managed processes in the first release.uv run --no-sync pytest -q
2590 passed, 32 skipped, 177 warnings
real PostgreSQL migration, pgvector, and release-migrator suites
21 passed, 11 warnings
uv run --no-sync ruff check .
uv lock --check
git diff --check
passed
The full suite ran without the closed adapter installed, proving the open-source single-Workspace/multi-user path remains standalone. Focused closed-adapter, directory projection, runtime connector, Box cleanup, and configuration suites also passed with the adapter installed.
SDK full suite
1226 passed, 22 existing warnings
Ruff check and format check
git diff --check
passed
A privileged Linux test container with host cgroup namespace ran one shared Runtime and two Workspace installations:
memory.max=134217728, memory.swap.max=0,
pids.max=32, and cpu.max=500000 1000000;EAGAIN;The same run started the Runtime from a non-root working directory, covering absolute nsjail mount-source normalization.
MIGRATIONS_TEST_DSN=... MIGRATIONS_TEST_DSN_FRESH=... \
go test -count=1 ./...
go vet ./...
passed against PostgreSQL 16
fresh PostgreSQL app startup, partial-baseline migration,
Cloud v2 migration rerun, and control-plane integration
passed
closed adapter pytest and Ruff
passed
pnpm exec tsc --noEmit
pnpm check:i18n
pnpm check:cloud-checkout-currency
passed; 7 checkout/currency cases
The PostgreSQL checks started from an empty database and verified all 34 registered migrations in order, Cloud v2 Free/Pro seeds, legacy plan seeds, Cloud columns/indexes, payment callback constraints, New API outbox/ownership constraints, and repeatable reruns.
Using an isolated Space PostgreSQL database and a migrated Core PostgreSQL database:
A real local browser operated the Space frontend and backend:
¥490.00 CNY.money=490.00; no USD amount was
sent through the CNY-only rail.TRADE_SUCCESS callback returned success. An exact replay
also returned success, leaving one successful order and one Pro Workspace
subscription.The browser run used the real Space UI and HTTP handlers. Its disposable local development harness added a same-origin Next.js rewrite only in the temporary worktree; that harness change was removed after the run.
The legacy feature-flag branch was then covered by API/static checks and the
production build: false or missing cloud_v2_enabled renders the original
Welcome/Pod client; a failed web-config request renders an explicit retry
instead of guessing a deployment mode.
Core completed signed manifest verification and directory projection, then stopped at the Box readiness gate because the current nsjail backend cannot prove hard Workspace byte/inode quota enforcement. Connector shutdown and reconnect tasks were cleanly reaped; no event-loop or never-awaited coroutine warning remained.
This is a successful fail-closed acceptance result, not a passing production Cloud boot.
Cloud v2 must remain disabled until these gates are closed:
processing orders and persisted permanent fulfillment conflicts.These gates intentionally add no tenant-specific service. They are implemented inside the existing Space, Core, Plugin Runtime, Box Runtime, and PostgreSQL components to preserve the architecture goal: near-zero static cost for a new Workspace.