Skip to content

Supervisor: per-subject admission quota #360

Closed

Description

@pdettori

Problem

The supervisor's admission gate (packages/supervisor/src/admission.ts, isSaturated) bounds the worker pool as a whole: a turn is refused (429 overloaded) only when no healthy worker is below the per-worker in-flight cap. Nothing bounds a single user. Under MI1's multi-user model, one subject can take every turn slot on a host and starve every other user, deliberately or through a runaway client.

What closing it needs

  • A per-subject in-flight limit (and possibly a rate limit), enforced where the subject is known. That is the harness after resolveTurnAuth, or the supervisor once S2's grants name the user on the request.
  • A distinct refusal (429 with a code such as subject_quota_exceeded, plus Retry-After), so a client can tell "you are over your share" from "the host is full".
  • Config: a default per-subject cap relative to total slots, with the operator able to set it.
  • Tests: subject A at its cap is refused while subject B is still admitted.

Context

docs/specs/2026-09-28-moca-multi-user-isolation-design.md §13 ("Per-user admission quota") assigns this to S2, alongside the grants that name the user. It was raised in round 1 of #350's review. It is related to, but distinct from, rossoctl/moca-experiments#6, which is about testing the admission gate itself.

Assisted-By: Claude (Anthropic AI) [email protected]

Activity

  1. added
    enhancement
    on Sep 29, 2026
  2. added 2 commits that reference this issue on Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions