IF Commons GitHub

Arca tenancy

0029Active

0029-arca-tenancy · owner if · domain data

The module

FR-001checkpassing

The tenancy module MUST be a module (0028-modules) named arcaTenancy that requires arcaParty and holds the concept tenant and the code lists tenantKind, tenantStatus and isolation, importing the party model through its entry of exports.

Enforced (check): .github: cd commons/data && bun run verify — suite/identity.test.ts: each module names what it requires, a project composes only what it needs and gets no table of the others, and a module whose requirement is not listed is an error as a value

Proved by: data/suite/identity.test.ts

Written in: data/models/arca-tenancy/mod.ts, data/models/arca-tenancy/tenancy.ts

Tests: passed: suite/identity.test.ts each module names what it requires, a project composes only what it needs and gets no tabl

FR-002checkpassing

A tenant MUST have an identifier, a kind (platform, reseller, business or consumer pool), a slug that is unique among tenants, a display name, an ancestry (the path of its parents from the root, kept by the operation that moves a tenant), a status (active, suspended or closed), an isolation (shared or dedicated) and the time it was made; it MAY have an organization (a consumer pool has none) and a parent, and MUST NOT be its own parent.

Enforced (check): .github: cd commons/data && bun run verify — suite/identity.test.ts: each module names what it requires, a project composes only what it needs and gets no table of the others, and a module whose requirement is not listed is an error as a value

Proved by: data/suite/identity.test.ts

Written in: data/models/arca-tenancy/tenancy.ts

Tests: passed: suite/identity.test.ts each module names what it requires, a project composes only what it needs and gets no tabl

FR-003checkpassing

Projected and bound for each of the three dialects and loaded into the real engines, the tenant MUST be a table whose slug is unique, whose kind, status and isolation are checked against their code lists, whose parent is a foreign key to a tenant, and which refuses to be its own parent.

Enforced (check): .github: cd commons/data && bun run verify — suite/identity.test.ts: the whole composition binds for each dialect and loads into each real engine, and on every engine a principal of any of the five kinds has a status and an owner that is not itself, and a tenant has a unique slug and is not its own parent

Proved by: data/suite/identity.test.ts

Written in: data/models/arca-tenancy/tenancy.ts

Tests: passed: suite/identity.test.ts the whole composition binds for each dialect and loads into each real engine, and on every

Out of scope

  • The operations that move a tenant, close it or keep its ancestry (a later specification, with the identity operations).
  • Row-level scope of other concepts by tenant: a composition overlay (a later specification).
  • Environments (development, production): deployment, not data.

Edge cases

  • The root tenant has no parent, per FR-002.
  • A tenant that cycles through its parents: not found by a constraint; the operation that moves a tenant refuses it, per FR-002.

Assumptions

  • Acyclicity of the hierarchy and its depth limit are preconditions of the operations that move a tenant.

Open questions

OQ-1open question

Whether the hierarchy's acyclicity can be said in governance (no annotation says it).

Key entities

  • Tenant - a boundary that separates one customer's data from another's.

Success criteria

SC-001success criterion

A project adopts tenants without identity, or identity with tenants, and gets only the tables it listed.

Review & acceptance checklist

  • [x] Every requirement is testable (MUST / MUST NOT), not aspirational
  • [x] No company fact is asserted here
  • [x] Every open item is marked, not silently decided

Cited by

Data, models/arca-tenancy/tenancy, Identity

Titles, headings, exports, tables, columns and requirements. Esc closes.