Skip to content
Toolkit

ADR-0135 — A seat is counted by the workspace that holds it

Status: Accepted · Date: 2026-08-30 · Track: 011 phase 02 · Supersedes: nothing · Builds on: ADR-0130, ADR-0013

Context

The overview sells seats. The quota registry had no seat axis, and the axis nearest to one — teams_limit — counts something else entirely: its own description says "legacy teams plus shared workspaces the user owns". That bounds how many workspaces an account may have, never how many colleagues may be in one. WorkspaceHandler.AddMember, the single path that adds a member, checked no quota at all.

PlanLimitService had two shapes for an axis, and neither fitted. CountFunc is handed a user and counts what that account owns. MagnitudeFunc is handed a scope and measures what a workspace holds in a continuous unit (ADR-0130). A seat is the missing corner: a count, arriving one at a time, of what a workspace holds.

Registering a seat counter as a CountFunc would have compiled and produced a plausible number — that account's memberships across every workspace it belongs to. It would have refused the wrong people for the wrong reason, and no test comparing a limit against a count would have noticed.

Decision

seats_limit counts a workspace's roster, and the function that counts it is handed the workspace.

  • ScopeCountFunc and RegisterScopeCount are the third registration shape. What a counter is handed is what the axis means, so the shapes stay separate rather than widening CountFunc to take an ambiguous id.
  • checkScope uses the count's comparison, current >= max, not checkPending's current + pending > max: a seat arrives one at a time, which is exactly the case ADR-0130 says the count comparison is right for.
  • The roster is counted by WorkspaceRepository.CountMembers — every membership row, the owner's included, because a seat is a person in the workspace.
  • The refusal lives in AddMember, below the duplicate-membership check: an add that would change nothing must not be refused for want of a seat it would not take.
  • Both reads fail open (ADR-0013). The axis ships unseeded, so it changes nothing anywhere until a plan carries a number — and which numbers those are is the charter's Blocker 1, the owner's.

Whose plan bounds a shared workspace — the acting member's or the workspace owner's — is the charter's Blocker 4 and is settled for every axis at once in phase 04. Until then this reads the actor's plan against the workspace's count, which is exactly what the storage axis does, so the two move in one commit when that answer lands rather than needing to be found again.

Consequences

  • The seat axis is enforced where it serves, and its row closes on the refusal rather than on the key existing: with the check removed from AddMember, the handler test fails, and with the counter handed the actor instead of the workspace, the service test reports the roster counted for the wrong id.
  • The admin plan form gains a Seats row with no frontend change, because it draws the registry (ADR-0030).
  • Three registration shapes now exist. A fourth axis kind should ask what its counter is handed before it asks what it compares — that question, not the comparison, is where a quota silently becomes a different product.

Source: docs/decisions/0135-a-seat-is-counted-by-the-workspace-that-holds-it.md

Library