Strict TenantScope & Cross-Tenant Negative Testing
Every operational table in app/ carries a non-null tenant_id column and leads lookup indexes with tenant_id. Route handlers never query raw D1 outside TenantScope.
- Session, paired bay-device token, and scoped inspector link are resolved server-side before any query runs.
- Any request parameter supplying a conflicting tenantId or role is rejected immediately with 403 Forbidden.
- Every release must pass the automated multi-tenant negative test suite verifying zero cross-tenant leakage between Tenant A and Tenant B.