chore: sync the kit at b06af1f (#11)

This takes three changes of the kit. With DEVKIT_ISOLATED=1, a gate takes
a gate slot, and verify.toml can mark a stage heavy. The gate can run the
selection of the fast stage (test-python-selected). A make pytest with
more than two xdist workers waits for a gate slot, and the adversarial
prompt tells the agent not to run the whole suite.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
diff --git a/.claude/commands/adversarial.md b/.claude/commands/adversarial.md
index c4b85c6..fea9cd8 100644
--- a/.claude/commands/adversarial.md
+++ b/.claude/commands/adversarial.md
@@ -59,7 +59,9 @@
 >    a check that says "nothing found" when it failed to look is the worst of the three.
 >
 > Verify a suspicion before reporting it. Run things in the dev container - never `uv`,
-> `pytest`, `yarn` or `node` on the host - and never pipe a container wrapper into
+> `pytest`, `yarn` or `node` on the host. Run the tests that show a finding, serially or
+> with at most `-n 2`, and never the whole suite: the gate has run it on this commit, and
+> other sessions share the machine. Never pipe a container wrapper into
 > `head`/`tail`, which a guard refuses; redirect to a file and read the file. You may
 > write throwaway scripts inside the worktree and delete them; `git status` must be clean
 > when you finish, and say so if it was not clean when you started.
diff --git a/AGENTS.shared.md b/AGENTS.shared.md
index e08cd24..3c60448 100644
--- a/AGENTS.shared.md
+++ b/AGENTS.shared.md
@@ -35,7 +35,7 @@
   | `make container-check` | the pre-commit hooks, over what changed since `origin/main` |
   | `make container-check-all` | every hook over every file, as `verify` and CI run them |
   | `make container-test` | pytest + vitest |
-  | `make container-pytest ARGS='...'` | one question: `ARGS='tests/api/test_x.py -k rename -q'`, serial |
+  | `make container-pytest ARGS='...'` | one question: `ARGS='tests/api/test_x.py -k rename -q'`, serial; with more than two workers (`-n 4`) it waits for a gate slot, as the suite does |
   | `make container-test-fast` | while iterating: what this change most likely breaks, first failure stops it; exits 10 when the change needs `container-test` (CONTRIBUTING.md). Not the gate - `container-verify` is |
   | `make container-test-coverage` | pytest with coverage instrumentation (slower, python only) |
   | `make container-test-py314` | the tests in a venv of their own on 3.14 (`DEVKIT_PYTHON`); 3.14 is the default too |
@@ -65,10 +65,10 @@
   than run as something else: `DEVKIT_PYTHON` (so `make container-test-py314`),
   `DEVKIT_DETACH` and `DEVKIT_PORT` (so `make container-keep`); run `scripts/run-dev.sh`
   for the app. What exists only to bound a container does nothing there, and says
-  nothing: the memory cap, `DEVKIT_MEMORY`, the sizing and its gate slots
-  (`DEVKIT_SIZE_WORKERS`), `DEVKIT_CONTAINER_NAME`, `DEVKIT_KEEP`,
+  nothing: the memory cap, `DEVKIT_CONTAINER_NAME`, `DEVKIT_KEEP`,
   `DEVKIT_E2E_WORKERS`, and `make container-stop`, which has nothing to stop. The
-  deadline, `DEVKIT_TIMEOUT`, does apply. The box needs the packages of
+  deadline, `DEVKIT_TIMEOUT`, does apply, and so do the sizing and the gate slots
+  below: sessions share a box as they share a host. The box needs the packages of
   [CONTRIBUTING.md](CONTRIBUTING.md) Option C, `make init` for yarn, and what
   `make e2e-test-host` needs (node, subversion, and the system libraries Chromium
   runs on) for the e2e suite.
@@ -87,7 +87,9 @@
   every worktree of the repository shares, one on a 15 GiB machine. A run that finds every slot
   held waits and says who holds them, rather than starting beside them and being OOM-killed, so
   there is no need to gate one at a time. `PYTEST_WORKERS` or `DEVKIT_MEMORY` given outright
-  replaces the size, not the wait; CI keeps its pinned settings. What the slots do not cover - a
+  replaces the size, not the wait; CI keeps its pinned settings. Inside one gate, a stage that
+  `scripts/local/verify.toml` marks `heavy` - one that runs the suite, or as much - waits for the
+  heavy stage before it, so that the gate runs no two suites at once. What the slots do not cover - a
   narrow pytest, the fast stage, an e2e server, a clone kept elsewhere - is in
   [docs/troubleshooting.md](docs/troubleshooting.md#a-gate-waits-for-a-slot).
 
@@ -96,6 +98,13 @@
   an svn repository of its own first, so for a handful of tests that setup costs more
   than the parallelism saves, and interleaved output is not worth reading anyway.
 
+  A service may have its gate run the selection of the fast stage instead of the whole
+  suite: its `scripts/local/verify.toml` names the stage `test-python-selected` in place of
+  `test-python`. The gate then runs every test the change most likely reaches, reports
+  every failure among them, and runs the whole suite where the change needs it. CI runs
+  the whole suite on every push, and is what catches what the selection does not hold. The
+  selection audit says how often that happens.
+
   `make e2e-test` reaches the app by container ip over plain http, which is
   deliberately not a secure context - browser APIs gated on one are absent
   there, so a feature depending on one fails in the suite instead of in front of
diff --git a/devkit.lock b/devkit.lock
index 2bd1896..fde73d9 100644
--- a/devkit.lock
+++ b/devkit.lock
@@ -1 +1 @@
-commit beaa2c9a8330a170fa06b8768636be12d7048cd6
+commit b06af1f7b025c87fd54371f9578a973c3c8d02ef
diff --git a/devkit.mk b/devkit.mk
index dbecf9b..917450c 100644
--- a/devkit.mk
+++ b/devkit.mk
@@ -23,7 +23,7 @@
 
 devkit_mk_goal := $(.DEFAULT_GOAL)
 
-.PHONY: check check-all lint test test-python test-frontend test-fast test-coverage pytest verify verify-fresh \
+.PHONY: check check-all lint test test-python test-python-selected test-frontend test-fast test-coverage pytest verify verify-fresh \
 	quality quality-show quality-base snapshot snapshot-base snapshot-full \
 	e2e-test e2e-test-host e2e-quick e2e-typecheck \
 	container-check container-check-all container-test container-test-fast container-test-coverage container-test-py314 \
@@ -113,6 +113,18 @@
 test-fast:
 	$(FAST_STAGE_RUN)
 
+# The gate's Python tests, for a service whose verify.toml names this stage in place of `test-python`: the
+# fast stage's selection, run whole so that every failure in it is reported, and the whole suite where the
+# change needs it - `--gate` exits 10 for that without running the selection. CI runs the whole suite on
+# every push, and is what catches what the selection does not hold.
+#
+# Make runs a recipe line that names $(MAKE) itself even under `make -n`, and verify.py reads a stage's
+# recipe with `make -n`: through a variable of its own, the line is only printed.
+THE_SUITE = $(MAKE) --no-print-directory test-python
+test-python-selected:
+	$(FAST_STAGE) run --gate $(if $(FAST_BASE),--base $(FAST_BASE)) -- $(PYTEST_PARALLEL); status=$$?; \
+		if [ $$status -eq 10 ]; then $(THE_SUITE); else exit $$status; fi
+
 # One question, asked as narrowly as you can ask it:
 #
 #   make pytest ARGS='tests/test_webapp.py -k login -q'
diff --git a/scripts/ci/fast_stage.py b/scripts/ci/fast_stage.py
index 8ff6077..bfbc108 100644
--- a/scripts/ci/fast_stage.py
+++ b/scripts/ci/fast_stage.py
@@ -35,6 +35,11 @@
 It never runs the whole suite. A change that reaches every test (`FULL_WHEN`, what tests/conftest.py
 imports), or a selection past `SHARE_LIMIT`, still runs what it selected, up to the limit, and then answers
 `NEEDS_THE_SUITE`, never a pass: the whole suite wants what `make container-test` sizes. Nothing is retried.
+
+`run --gate` is the same selection as the gate's Python tests (`make test-python-selected`): run whole, so
+that every failure in it is reported and not the first; without vitest, which the gate runs as a stage of
+its own; and, where the change needs the whole suite, running nothing and answering `NEEDS_THE_SUITE` at
+once, for the make target to run the whole suite instead. CI runs the whole suite on every push either way.
 """
 
 from __future__ import annotations
@@ -94,6 +99,7 @@
     "This was the fast stage, not the gate: run `make container-verify` before you push. "
     "CI runs the whole suite on every push."
 )
+THE_GATE_SAYS: Final = "The gate ran this change's selection; CI runs the whole suite on every push."
 NEEDS_THE_SUITE_SAYS: Final = (
     "Run the whole suite with `make container-test` (`make test` in the container); when it passes on a"
     " clean tree it records a new base, and the next fast run is narrow again. Until then"
@@ -379,18 +385,31 @@
     return "\n".join(lines)
 
 
-def _verdict(status: int, plan: Plan) -> tuple[int, str]:
+def _verdict(status: int, plan: Plan, *, gate: bool = False) -> tuple[int, str]:
+    stage = "The selection" if gate else "Fast stage"
     if status != 0:
-        return status, "Fast stage FAILED."
+        return status, f"{stage} FAILED."
     if plan.reasons:
         return (
             NEEDS_THE_SUITE,
             f"Fast stage ran its selection; this change needs the whole suite. {NEEDS_THE_SUITE_SAYS}",
         )
-    return 0, "Fast stage passed."
+    return 0, f"{stage} passed."
 
 
-def run(root: pathlib.Path, given_base: str | None, pytest_arguments: list[str]) -> int:
+def _gate_cannot_select(plan: Plan) -> int | None:
+    """What the gate answers without running pytest: the whole suite where the change needs it, and a pass
+    where it selects nothing. None where it has a selection to run."""
+    if plan.reasons:
+        print("\nThis change needs the whole suite, which the gate runs in place of a selection.", flush=True)
+        return NEEDS_THE_SUITE
+    if not plan.rules:
+        print(f"\nThe selection holds no test file, so there is nothing for the gate to run. {THE_GATE_SAYS}")
+        return 0
+    return None
+
+
+def run(root: pathlib.Path, given_base: str | None, pytest_arguments: list[str], *, gate: bool = False) -> int:
     try:
         fast_stage_rules.load_rules(root, FULL_WHEN)
     except fast_stage_rules.LocalError as error:
@@ -401,20 +420,24 @@
     known = read_json(root / DURATIONS)
     plan = make_plan(root, changed, known if isinstance(known, dict) else {}, failed_before(root))
     print(describe(base, committed, uncommitted, plan), flush=True)
+    if gate and (answer := _gate_cannot_select(plan)) is not None:
+        return answer
     if not plan.rules:
         status = NEEDS_THE_SUITE if plan.reasons else NOTHING_SELECTED
         print(f"\nThe fast stage selected no test file, and runs none. {NEEDS_THE_SUITE_SAYS} {NOT_THE_GATE}")
         return status
     junit = root / STATE / "junit-fast.xml"
-    pytest = [str(pathlib.Path(sys.executable).with_name("pytest")), "--failed-first", "--maxfail=1"]
+    pytest = [str(pathlib.Path(sys.executable).with_name("pytest")), "--failed-first"]
+    if not gate:
+        pytest.append("--maxfail=1")
     status = subprocess.run([*pytest, f"--junitxml={junit}", *pytest_arguments, *plan.rules], cwd=root).returncode
     record(root, junit, status, full=False)
-    vitest = vitest_command(root, changed)
+    vitest = None if gate else vitest_command(root, changed)
     if status == 0 and vitest:
         print(f"$ {' '.join(vitest)}", flush=True)
         status = subprocess.run(vitest, cwd=root / "assets").returncode
-    status, said = _verdict(status, plan)
-    print(f"\n{said} {NOT_THE_GATE}")
+    status, said = _verdict(status, plan, gate=gate)
+    print(f"\n{said} {THE_GATE_SAYS if gate else NOT_THE_GATE}")
     return status
 
 
@@ -423,6 +446,7 @@
     commands = parser.add_subparsers(dest="command", required=True)
     stage = commands.add_parser("run", help="the fast stage; arguments after -- go to pytest")
     stage.add_argument("--base", help="measure the change from where this commit and HEAD meet instead")
+    stage.add_argument("--gate", action="store_true", help="the gate's selection: every failure, no vitest")
     stage.add_argument("pytest_arguments", nargs="*")
     commands.add_parser("begin", help="note HEAD and the tree before a full run of a half").add_argument("half")
     done = commands.add_parser("record", help="keep what a full run's junit report says")
@@ -431,7 +455,7 @@
     commands.add_parser("passed", help="a half passed; both on one clean commit make it green").add_argument("half")
     arguments = parser.parse_args()
     if arguments.command == "run":
-        return run(ROOT, arguments.base, arguments.pytest_arguments)
+        return run(ROOT, arguments.base, arguments.pytest_arguments, gate=arguments.gate)
     if arguments.command == "record":
         record(ROOT, arguments.junit, arguments.status, full=True)
     else:
diff --git a/scripts/ci/verify.py b/scripts/ci/verify.py
index c2ee526..7be6442 100644
--- a/scripts/ci/verify.py
+++ b/scripts/ci/verify.py
@@ -21,7 +21,10 @@
 `make verify` runs each stage as the make target of the same name, all of them at the same time:
 pytest keeps up to six workers busy, and the rest - the hooks, the linters, vitest, the behaviour record and
 the quality ratchet - fit beside it on the cores it leaves, so the gate takes about as long as its
-longest stage rather than the sum of them. Each stage writes its own log under state/verify/, and
+longest stage rather than the sum of them. A stage that runs the service's test suite, or as much,
+says it is `heavy`, and no two heavy stages run at once: two suites side by side double the peak of
+the gate, and with several sessions on one machine that peak is what they all feel. The `longest`
+stage is started first. Each stage writes its own log under state/verify/, and
 what is printed is one line per stage, and the end of the log of one that failed.
 
 A stage that passed is not run again until something it reads changes. What it reads is its key: the
@@ -59,6 +62,7 @@
     extras = ["quality-base"]
     reads_makefile = false
     longest = true                      # the stage the gate waits for
+    heavy = true                        # runs the suite, or as much: one heavy stage at a time
 
 The file is data, read with tomllib: nothing of the repository is imported to run the gate.
 """
@@ -100,6 +104,9 @@
     longest: bool = False
     """The stage the gate waits for. The others run niced, so that the cores go to it first and the
     rest fill what it leaves."""
+    heavy: bool = False
+    """Whether the stage runs the service's test suite, or as much: it starts once the heavy stage
+    before it has ended (`_after`)."""
 
 
 _BUILTIN_ENVIRONMENT = ("DEVKIT_PYTHON", "PYTEST_ADDOPTS")
@@ -134,7 +141,7 @@
 """Where a repository states its stages, from the root of the repository."""
 
 _EXTRA_KEYS = {"file": {"path", "env"}, "trailers": set(), "command": {"run"}}
-_STAGE_KEYS = {"name", "paths", "extras", "reads_makefile", "longest"}
+_STAGE_KEYS = {"name", "paths", "extras", "reads_makefile", "longest", "heavy"}
 _NAME = re.compile(r"[A-Za-z0-9][A-Za-z0-9_.-]*")
 _VARIABLE = re.compile(r"[A-Za-z_][A-Za-z0-9_]*")
 
@@ -184,7 +191,7 @@
         paths = _strings(entry["paths"], f"{where}: paths", problems) if "paths" in entry else None
         used = _strings(entry.get("extras", []), f"{where}: extras", problems)
         problems += [f"{where}: no extra named {extra}" for extra in used if extra not in extras]
-        flags = {key: entry.get(key, False) for key in ("reads_makefile", "longest")}
+        flags = {key: entry.get(key, False) for key in ("reads_makefile", "longest", "heavy")}
         problems += [f"{where}: {key} is true or false" for key, flag in flags.items() if not isinstance(flag, bool)]
         stages.append(Stage(name, paths=paths, extras=used, **flags))
     return tuple(stages)
@@ -344,6 +351,15 @@
     return Outcome(stage, "passed", seconds, log)
 
 
+def _after(
+    previous: concurrent.futures.Future[Outcome] | None, stage: Stage, config: Config, *, fresh: bool
+) -> Outcome:
+    """`run`, once `previous` has ended, however it ended."""
+    if previous is not None:
+        concurrent.futures.wait([previous])
+    return run(stage, config, fresh=fresh)
+
+
 def report(outcome: Outcome) -> str:
     name, log = outcome.stage.name, outcome.log.relative_to(ROOT)
     if outcome.verdict == "unchanged":
@@ -378,7 +394,13 @@
     print(f"verify: {len(chosen)} stages at once - {', '.join(s.name for s in chosen)}", flush=True)
     outcomes: list[Outcome] = []
     with concurrent.futures.ThreadPoolExecutor(max_workers=len(chosen)) as pool:
-        futures = [pool.submit(run, stage, config, fresh=args.fresh) for stage in chosen]
+        futures = []
+        heavy: concurrent.futures.Future[Outcome] | None = None
+        # the longest first, so that it is the heavy stage that does not wait
+        for stage in sorted(chosen, key=lambda stage: not stage.longest):
+            future = pool.submit(_after, heavy if stage.heavy else None, stage, config, fresh=args.fresh)
+            heavy = future if stage.heavy else heavy
+            futures.append(future)
         for future in concurrent.futures.as_completed(futures):
             outcomes.append(future.result())
             print(report(outcomes[-1]), flush=True)
diff --git a/scripts/container-size.sh b/scripts/container-size.sh
index 4b21218..e49dce9 100644
--- a/scripts/container-size.sh
+++ b/scripts/container-size.sh
@@ -4,8 +4,9 @@
 # the slots that keep the runs of several sessions from asking for more memory than the machine has.
 #
 # Sourced by container.sh, like checkout-id.sh. A run of the whole suite is sized: one whose command
-# is `make test`, `test-python`, `verify`, `verify-fresh` or `test-coverage`, or `uv run
-# scripts/ci/verify.py` (gate_suite_workers), or one given DEVKIT_SIZE_WORKERS, the most workers its
+# is `make test`, `test-python`, `verify`, `verify-fresh` or `test-coverage`, `uv run
+# scripts/ci/verify.py`, or a `make pytest` whose ARGS or make line ask for more than two xdist workers
+# (gate_suite_workers), or one given DEVKIT_SIZE_WORKERS, the most workers its
 # command can use - which the Makefile's container-* targets set. Everything here runs on the host,
 # before the container starts, because the memory cap is fixed when it does.
 #
@@ -71,6 +72,10 @@
 GATE_WORKER_MIB=512
 GATE_BASE_MIB=6912
 
+# The most workers a narrow `make pytest` may ask for and stay outside the slots: past it, it is sized and waits
+# for a slot as a run of the suite does.
+GATE_NARROW_WORKERS=2
+
 # What is left to everything else, and the run a slot is sized for: the six workers of a gate.
 GATE_SPARE_MIB=1024
 GATE_SLOT_WORKERS=6
@@ -167,6 +172,16 @@
                         echo "$GATE_SLOT_WORKERS"
                         return
                         ;;
+                    # one question, serial, unless it asks for more workers than a narrow run wants: then it
+                    # loads the machine as the suite does, and waits for a slot as the suite does
+                    pytest)
+                        _asked=$(gate_make_workers make "$@")
+                        case $_asked in
+                            '' | *[!0-9]*) ;;
+                            *) [ "$_asked" -le "$GATE_NARROW_WORKERS" ] || echo "$_asked" ;;
+                        esac
+                        return
+                        ;;
                     # serial
                     test-coverage)
                         echo 1
@@ -186,19 +201,51 @@
     esac
 }
 
-# The PYTEST_WORKERS given on a make command line among $@, which beats the environment's there.
+# The PYTEST_WORKERS given on a make command line among $@, which beats the environment's there - or the
+# xdist count in its ARGS, which comes after it on pytest's command line and so beats that too. `auto` and
+# `logical` are a slot's worth.
 gate_make_workers() {
     [ "${1:-}" = make ] || return 0
     _found=''
+    _xdist=''
     for _arg in "$@"; do
         case $_arg in
             PYTEST_WORKERS=*) _found=${_arg#*=} ;;
+            ARGS=*)
+                # split into words, and not globbed: ARGS names paths
+                # shellcheck disable=SC2086  # the split is the point; set -f keeps a path in it from globbing
+                _xdist=$(set -f && gate_xdist_workers ${_arg#ARGS=})
+                ;;
             *) ;;
         esac
     done
+    case $_xdist in
+        auto | logical) _found=$GATE_SLOT_WORKERS ;;
+        '') ;;
+        *) _found=$_xdist ;;
+    esac
     [ -z "${_found:-}" ] || echo "$_found"
 }
 
+# The count pytest-xdist is given among the words $@: `-n N`, `-nN`, `--numprocesses N` or
+# `--numprocesses=N`, the last of them; nothing where there is none.
+gate_xdist_workers() {
+    _n=''
+    while [ "$#" -gt 0 ]; do
+        case $1 in
+            -n | --numprocesses)
+                _n=${2:-}
+                [ "$#" -lt 2 ] || shift
+                ;;
+            --numprocesses=*) _n=${1#*=} ;;
+            -n*) _n=${1#-n} ;;
+            *) ;;
+        esac
+        shift
+    done
+    echo "$_n"
+}
+
 # Whether this run is one to size: a command that asked for it, outside CI, on a machine whose memory
 # can be read.
 gate_wanted() {
@@ -306,7 +353,8 @@
 }
 
 # Size this run, and take a slot, waiting for one where all are held. Sets WORKERS, MEMORY and
-# TIMEOUT for container.sh; MEMORY is left as it was where DEVKIT_MEMORY was given.
+# TIMEOUT for container.sh; MEMORY is left as it was where DEVKIT_MEMORY was given, and is empty where
+# the run has no container to cap (GATE_NO_CONTAINER).
 gate_size() {
     _max=$(gate_number DEVKIT_SIZE_WORKERS "$DEVKIT_SIZE_WORKERS")
     _given_workers=''
@@ -373,5 +421,6 @@
         _where='no slot: no git directory to share them in, or no flock that works'
         echo "container.sh: $_where - sized, but not kept from other runs" >&2
     fi
+    [ -z "${GATE_NO_CONTAINER:-}" ] || MEMORY=''
     echo "container.sh: $WORKERS pytest workers in ${MEMORY:-no cap}, deadline ${TIMEOUT:-none}s ($_where)" >&2
 }
diff --git a/scripts/container.sh b/scripts/container.sh
index 89e4f0a..04b7edb 100755
--- a/scripts/container.sh
+++ b/scripts/container.sh
@@ -21,8 +21,8 @@
 #   DEVKIT_PYTHON=3.14 scripts/container.sh make test
 #
 # A run of the whole suite - `make test`, `test-python`, `verify`, `verify-fresh` or
-# `test-coverage`, or `uv run scripts/ci/verify.py` - is sized to the machine and takes one of its
-# gate slots, whether it comes through a container-* target or straight here: see
+# `test-coverage`, `uv run scripts/ci/verify.py`, or a `make pytest` asking for more than two xdist
+# workers - is sized to the machine and takes one of its gate slots, whether it comes through a container-* target or straight here: see
 # scripts/container-size.sh. A command wrapped in `sh -c` is not recognised as one.
 #
 # Environment:
@@ -31,8 +31,10 @@
 #                     versions are reproduced locally)
 #   DEVKIT_ISOLATED      set to `1` where the whole environment is disposable (an isx
 #                     box): the command runs in this checkout directly, with no
-#                     container. DEVKIT_TIMEOUT applies; DEVKIT_PYTHON, DEVKIT_DETACH and
-#                     DEVKIT_PORT are refused, since each needs a container of its own
+#                     container. DEVKIT_TIMEOUT applies, and a run of the whole suite is
+#                     sized and takes a gate slot, with no memory cap; DEVKIT_PYTHON,
+#                     DEVKIT_DETACH and DEVKIT_PORT are refused, since each needs a
+#                     container of its own
 #   DEVKIT_RUNTIME       container runtime to use (default: podman, else docker)
 #   DEVKIT_VENV_VOLUME   name the virtualenv volume outright, rather than taking the
 #                     one derived from this checkout
@@ -132,10 +134,31 @@
     exit 2
 fi
 
+# A run of the whole suite is sized to the machine and takes one of its gate slots, on descriptor 8,
+# which whatever runs the command inherits: the slot is held until that ends, and let go by the
+# kernel however it ends. Called last before the run, so that an image build or a volume copy holds
+# no slot.
+#
+# The command itself says whether it is such a run, where no target said so (gate_suite_workers);
+# and a PYTEST_WORKERS on its make line beats the environment's in there, so it is the count here.
+size_this_run() {
+    [ -n "${DEVKIT_SIZE_WORKERS+set}" ] || DEVKIT_SIZE_WORKERS=$(gate_suite_workers "$@")
+    make_workers=$(gate_make_workers "$@")
+    [ -z "$make_workers" ] || PYTEST_WORKERS=$make_workers
+    WORKERS=${PYTEST_WORKERS:-}
+    if [ -z "$DETACH" ] && gate_wanted; then
+        gate_size
+    fi
+}
+
 # Already inside a disposable environment (DEVKIT_ISOLATED=1, see AGENTS.md): there is nothing
 # left to isolate from, and a container in it would only rebuild the image. The command runs
 # where it stands. What is for a container of its own has no meaning here and is refused,
 # where running it as something else would answer a different question.
+#
+# A run of the whole suite still takes a gate slot and is sized: several sessions share one box as
+# they share a host, and without the slot each gate starts beside the others. There is no
+# container to cap, so it has no memory cap (GATE_NO_CONTAINER).
 if [ "${DEVKIT_ISOLATED:-}" = 1 ]; then
     if [ -n "${DEVKIT_PYTHON:-}" ] || [ -n "$DETACH" ] || [ -n "${DEVKIT_PORT:-}" ]; then
         echo "DEVKIT_PYTHON, DEVKIT_DETACH and DEVKIT_PORT need a container of their own: not with DEVKIT_ISOLATED=1" >&2
@@ -145,6 +168,12 @@
     export PATH
     cd "$repo_root"
     sh "$script_dir/ensure-node-modules.sh" "$repo_root/assets"
+    GATE_NO_CONTAINER=1
+    size_this_run "$@"
+    if [ -n "$WORKERS" ]; then
+        PYTEST_WORKERS=$WORKERS
+        export PYTEST_WORKERS
+    fi
     if [ -z "$TIMEOUT" ]; then
         exec "$@"
     fi
@@ -185,20 +214,9 @@
 seed_volume "$VENV_VOLUME" "$DEVKIT_SERVICE-venv"
 seed_volume "$NODE_VOLUME" "$DEVKIT_SERVICE-node"
 
-# A run of the whole suite is sized to the machine and takes one of its gate slots, on descriptor 8,
-# which the `podman run` below inherits - and, under podman, conmon and the network helper with it:
-# the slot is held until the container ends, and let go by the kernel however it ends. Last before
-# the run, so that an image build or a volume copy holds no slot.
-#
-# The command itself says whether it is such a run, where no target said so (gate_suite_workers);
-# and a PYTEST_WORKERS on its make line beats the environment's in there, so it is the count here.
-[ -n "${DEVKIT_SIZE_WORKERS+set}" ] || DEVKIT_SIZE_WORKERS=$(gate_suite_workers "$@")
-make_workers=$(gate_make_workers "$@")
-[ -z "$make_workers" ] || PYTEST_WORKERS=$make_workers
-WORKERS=${PYTEST_WORKERS:-}
-if [ -z "$DETACH" ] && gate_wanted; then
-    gate_size
-fi
+# The slot is held by `podman run` - and, under podman, by conmon and the network helper with it -
+# so until the container ends.
+size_this_run "$@"
 
 # The inner script runs inside the container, so its variables must reach it
 # unexpanded - the single quotes around it are deliberate.