Skip to content

Federated read × org-walled deployment has no reachable end-to-end coverage — the required dogfood test that names the path boots single-tenant and cannot emit the predicate #7834

Description

@os-zhuang

Measured by #7738's dev, who then re-measured their own first explanation and found it wrong (report, correction). Filed unassigned.

The gate that should have caught #7738, and could not

packages/qa/dogfood/test/showcase-external-autoconnect.dogfood.test.ts:37 asserts rows.length >= 3 for an authenticated admin read of showcase_ext_customer. It is part of a required CI job (3 shards, ci.yml:709).

Per #7738's QA capture, that authenticated read returned 0 rows — a declared, correctly-bound external object silently answering empty. So this assertion is exactly the shape that should have failed, and CI was green.

The first explanation was plausible and wrong — the second is measured

The initial hypothesis was that the @objectstack/verify harness's signed-in admin carries no active org, leaving the wall dormant. Rather than leave that standing, the dev checked engine.ts back out at main, rebuilt @objectstack/objectql, and re-ran the same file: 3 passed / 3 — with the fix and without it.

That is the decisive measurement. The test does not merely fail to assert the wall; it never emits the predicate at all, in either direction. It could not have caught this defect and cannot catch a regression of it.

Mechanism, one line of harness:

  • bootStack sets OS_TENANCY_POSTURE=isolated only when opts.multiTenant is truthy — packages/verify/src/harness.ts:268. This test calls bootStack(showcaseStack) with no options.
  • Boot log confirms: [security] tenancy posture 'single' — Layer 0 is inert; the platform's own tenant-scoped RLS policies are stripped.
  • With no organization plugin and no active org, execCtx.tenantId is undefined, hasTenant is false at engine.ts:2528, the driver never receives a tenantId, and applyTenantScope early-returns.

The structural part — this is not a missing assertion

Per BootOptions.multiTenant's own docstring, the only honest way to boot the organization wall is multiTenant: true with the cloud-private @objectstack/organizations. 'posture-only' is explicitly documented as performing no isolation — "nothing stamps organization_id, nothing scopes a query" — and the gates that need the real wall SKIP without that package.

The intersection this bug lived in — a federated read × an org-walled deployment — has no reachable end-to-end coverage in this repo's dogfood tier. The one federated-read fixture boots single-tenant; the one honest walled harness is unavailable here.

Same class as #7802, different mechanism

#7802: a cross-package conformance scan is never run because affected-subset CI is keyed on the package the scan lives in.
This: a required test runs, passes, and names the path — while booting a posture in which the thing under test is inert.

Both are a green gate over a path it does not exercise, which is worse than an absent gate because it reads as coverage. Worth deciding together whether there is a general answer.

⛔ What not to do

  • Do not "fix" this by adding assertions to the single-tenant boot — that pins the inert path and deepens the illusion.
  • Do not mark the test skipped; it is doing useful work on the autoconnect path, just not on the wall.
  • Do not treat fix(objectql): withhold the org-scope predicate from federated objects (#7738) #7833's unit pin as closing this. That pin sits at the DriverOptions seam and is reachable without the enterprise package — it closes the regression risk, and it is genuinely not an end-to-end proof.

Step one — a decision, not code

Pick honestly between:

  1. a posture-aware fixture that can emit the org wall without the cloud-private package (if that is even possible — measure before promising it);
  2. accepting that this intersection is covered at the unit/seam tier only, and saying so in a comment on the dogfood test so the next reader does not mistake its assertion for coverage;
  3. something else — but not silence, because the current state is the failure mode.

Related

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions