# OSHUN Studio Enterprise Tenant Isolation Dependency and Data Contract Map

Status: Active  
Owner: OSHUN Studio Architecture + OSHUN Security + Platform Identity + OSHUN
Web + OSHUN BFF  
Last Updated: 2026-02-23  
Related: `docs/adr/ADR-0028-oshun-studio-enterprise-tenant-isolation.md`

## Purpose

Define dependencies and canonical contracts for Studio enterprise tenant
isolation across Yemaya, Isis, Hathor, Aja, Bellona, and Project Obsidian.

This document is the execution artifact for `OST-00122`.

## Sources Used

- `docs/adr/ADR-0010-shared-identity-and-cross-domain-session-model.md`
- `docs/adr/ADR-0028-oshun-studio-enterprise-tenant-isolation.md`
- `libs/oshun/auth/src/index.ts`
- `libs/oshun/domain-registry/src/index.ts`
- `docs/releases/v1/specs/studio-domain-dependency-and-data-contract-map.md`
- `docs/releases/v1/design/ux-principles.md`
- `docs/domains/yemaya/features.md`
- `docs/domains/isis/features.md`
- `docs/domains/hathor/features.md`
- `docs/domains/aja/features.md`
- `docs/domains/bellona/features.md`

## 1. Dependency Overview

### 1.1 Control Surfaces

- **Tenant-boundary UX surfaces**: Studio tenant-isolation workspaces in
  `apps/oshun/web/src/components/studio`.
- **Tenant identity and scope authority**: `libs/oshun/auth` + identity/tenant
  services.
- **Tenant policy and partition enforcement**: security policy engine + BFF.
- **Cross-domain tenant propagation**: domain adapters + orchestration services.
- **Telemetry and audit**: `libs/oshun/analytics` + security/compliance
  pipelines.

### 1.2 Domain Dependency Graph

- `Enterprise Tenant Isolation -> Yemaya`: tenant-scoped content governance
  requires strict partitioned reads/writes.
- `Enterprise Tenant Isolation -> Isis`: model/workflow actions require
  deterministic tenant policy boundaries.
- `Enterprise Tenant Isolation -> Hathor`: narrative governance requires
  tenant-specific publication and policy enforcement.
- `Enterprise Tenant Isolation -> Aja`: media/timeline workflows require
  tenant-safe collaboration and visibility controls.
- `Enterprise Tenant Isolation -> Bellona`: runtime/release operations require
  explicit tenant blast-radius boundaries.
- `Project Obsidian -> all`: central governance for tenant policy catalogs,
  boundary controls, and incident ownership.

## 2. Ownership and Contract Matrix

| Area                                | Owner                         | Consumers                         | Artifact                  | Contract                            |
| ----------------------------------- | ----------------------------- | --------------------------------- | ------------------------- | ----------------------------------- |
| Tenant context envelope             | Platform Identity + Security  | Web + BFF + Studio surfaces       | Tenant scope payload      | `StudioTenantContextEnvelope`       |
| Tenant policy decisioning           | Security + Program Governance | Studio governed actions           | Decision payload          | `StudioTenantPolicyDecision`        |
| Tenant boundary read/write controls | OSHUN BFF + Data Platform     | Domain adapters + Studio services | Boundary control policy   | `StudioTenantDataBoundaryRule`      |
| Cross-tenant exception workflow     | Security + Compliance         | Enterprise operators              | Exception request payload | `StudioCrossTenantExceptionRequest` |
| Audit/compliance evidence           | Data Platform + Security      | Governance + Compliance           | Event stream              | `StudioTenantIsolationAuditEvent`   |

## 3. Canonical Contracts

### 3.1 StudioTenantContextEnvelope

```ts
export interface StudioTenantContextEnvelope {
  tenantId: string;
  tenantSlug: string;
  actorId: string;
  role: string;
  environment: 'preview' | 'staging' | 'production';
  contextVersion: string;
  requestedAt: string;
}
```

### 3.2 StudioTenantPolicyDecision

```ts
export interface StudioTenantPolicyDecision {
  decisionId: string;
  tenantId: string;
  action: string;
  actorId: string;
  actorRole: string;
  outcome: 'allowed' | 'denied';
  reasonCode?: string;
  decidedAt: string;
}
```

### 3.3 StudioTenantDataBoundaryRule

```ts
export interface StudioTenantDataBoundaryRule {
  ruleId: string;
  tenantId: string;
  resourceType: string;
  operation: 'read' | 'write' | 'delete' | 'share';
  boundaryMode: 'strict' | 'exception';
  allowedScopes: string[];
  version: string;
}
```

### 3.4 StudioCrossTenantExceptionRequest

```ts
export interface StudioCrossTenantExceptionRequest {
  requestId: string;
  sourceTenantId: string;
  targetTenantId: string;
  action: string;
  justification: string;
  requestedBy: string;
  status: 'pending' | 'approved' | 'denied' | 'expired';
  decidedAt?: string;
}
```

### 3.5 StudioTenantIsolationAuditEvent

```ts
export interface StudioTenantIsolationAuditEvent {
  eventId: string;
  action:
    | 'tenant_context.requested'
    | 'tenant_policy.allowed'
    | 'tenant_policy.denied'
    | 'tenant_boundary.violation'
    | 'tenant_exception.requested'
    | 'tenant_exception.decided';
  outcome: 'allowed' | 'denied' | 'success' | 'error';
  tenantId: string;
  actorId: string;
  actorRole: string;
  resourceType?: string;
  reasonCode?: string;
  traceId: string;
  occurredAt: string;
}
```

## 4. Validation Rules

- Governed actions must include valid tenant context before execution.
- Cross-tenant actions are denied by default unless approved exception exists.
- Tenant data-boundary violations must hard-fail and emit violation events.
- All tenant policy and boundary outcomes must emit
  `StudioTenantIsolationAuditEvent` records.

## 5. Acceptance Criteria (OST-00122)

`OST-00122` is complete only when:

1. This dependency and contract map exists.
2. Dependencies for all five Studio domains plus Project Obsidian are mapped.
3. Contracts for tenant context, policy decision, boundary rules, exception
   requests, and audit events are documented.
4. Ownership boundaries and validation rules are explicit.
