Project quota / entitlement control plane (shape)
Rule
- Base
modu newis free and unlimited. - Pro’s
project_create(future/Pro-managed) checkslimits.projectsbefore 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})returnsPROJECT_QUOTA_EXCEEDEDwhen 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_createuses the same quota/registry path and is gated byMESA_MCP_ALLOW_APPLY=1; - when
MESA_CONTROL_PLANE_URL/MESA_CONTROL_PLANE_TOKENare 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 basemodu newfailure; - 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 serverused, entries whose dir no longer exists; it never mutates either side;- default registry:
~/.mesa-pro/projects.json(overrideMESA_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