Resource gate

Every Marvin project on this machine shares one queue for heavy runs. Parallel sessions never start several test suites or Docker stacks at once and take the machine down.

How it holds

Any session Tests, a Docker build or a stack, in any project. Hook Skipped the gate? Held: run it again through the gate. Queue One at a time, machine-wide, first in, first out. Floor Free memory ≥ 15 % on the host and in the Docker VM. Run The command runs, then the next in line goes. exit 75 · QUEUED or HELD: a wait. Re-run it, never a failed round. Stack slots · default 1 A detached start (up -d, run -d) keeps its slot until that worktree's down. Its own tests never wait on it. slot 1 · worktree B · up -d Meter · flags at 10 % Each worktree's labelled containers are measured. Over budget: flagged OVER on the board. Never held for that alone, never stopped.

On a narrow screen, scroll the diagram sideways.

What counts as heavy

Running one

bash '<gate path>' run -- npm test

Memory: the floor decides

Settings

KeyDefaultSets
resource_gateblockThe hook: block, advise or off.
resource_free_min_pct15The floor, % free.
resource_run_max_pct10The flag, % per worktree.
resource_stack_slots1Detached stacks at once.
resource_hold_max_min120Minutes until a holder is stale.

All optional, in .marvin/PROJECT-INFO.md. Details: resource-gate.md, the hook.