mesa-doc /mesa-pro/docs/project-quota
docs

Project quota / entitlement control plane (shape)

Rule

  • Base modu new is free and unlimited.
  • Pro’s project_create (future/Pro-managed) checks limits.projects before creating a project.
  • The local license check is a deterrent; the authoritative count belongs to the control plane (or the operator’s licensed record). Open-source clients can be modified — never claim a local check is a hard server-side limit.

Local registry shape

{
  "version": 1,
  "projects": [
    { "id": "shop", "dir": "/abs/shop", "createdAt": "2026-11-28T00:00:00Z" }
  ]
}
  • evaluateProjectCreation({limit, used}) returns PROJECT_QUOTA_EXCEEDED when over.
  • Record a project only after successful creation; deleting a project should free a slot only via the same registry/control-plane operation.
  • The same registry can be synced with a control-plane API later; do not add a second count store.

Implemented shape

  • mesa-project create --dir … --id … [--registry …];
  • MCP project_create uses the same quota/registry path and is gated by MESA_MCP_ALLOW_APPLY=1;
  • when MESA_CONTROL_PLANE_URL/MESA_CONTROL_PLANE_TOKEN are set:
    • the server-side reserve is authoritative — a stale local registry never rejects creation;
    • unreachable control plane fails creation closed with SYNC_UNAVAILABLE (no dir, no registry residue); release is called on base modu new failure;
    • the registry is written with cache semantics (upsert by id);
  • mesa-project release (--id | --dir) returns the slot to the control plane and drops the registry entry (requires the control plane pair);
  • mesa-project reconcile [--registry …] is a read-only drift report: registry count vs server used, entries whose dir no longer exists; it never mutates either side;
  • default registry: ~/.mesa-pro/projects.json (override MESA_PRO_REGISTRY).

Server-side enforcement

Implemented as of 2026-11-28 — see control-plane.md for the API, storage and ops shape (mesa-control-plane serve/license/token/backup/health). Remaining deliberate gaps: sync worker, multi-instance store, admin UI, billing.

源文件 · mesa-pro/docs/project-quota.md