Test load: one full suite at a time, a fair share of cores, fewer and cheaper runs

Status:built; the measuring and the switches are left to Jack
Date:2026-11-30
Branch:jack_20261130_3 (turn, cap, load, #362), jack_20261130_4 on top (governor, affected)
Type:plan

Goal

When several Claude Code sessions and their subagents work on one machine, their test runs stop fighting over the CPU:

The MacBook is where this hurts, and none of the numbers below come from it. Measuring it is the first open task.

What the transcripts show

This comes from jacked tests load (the same code as scripts/load_replay.py) over the Windows desktop's transcripts since 2026-09-01, subagents included, 24 cores.

Who / sizeRunsHoursMean seconds
subagent / targeted4,60015.112
subagent / full3127.992
main / targeted2,2208.714
main / full2564.767
main / background, probably full (no summary in the transcript)995.4196
no summary line (main and subagent)1,5977.216
All timed runs9,08449.1

An earlier count (8,538 runs, 44.6 h) missed every python -X utf8 -m pytest run: 544 runs, 4.4 h.

What is built

ControlWhat it doesWhat it reaches
jacked tests governor on (off by default)A PreToolUse hook refuses a subagent's whole-suite run and a --kind full gate around a runner, with a fixed reason. Whole suite: the folders a run names, or the folder it starts in, hold at least half of the repository's test files for that runner. A list of files, a filtered run, a suite under 10 files, a network path and jacked tests affected are never refused. It reads heredocs, line continuations, PowerShell's & and Git Bash /c/ paths as a shell does, and reads no escapes: a command it cannot read is allowed. The main session is never refused, and any error allows the call.Every subagent test run in Claude Code. Replayed over the subagent runs since 2026-09-01: refuses 190 of the 325 that the load replay counts as full, and 63 of 4,720 it counts as targeted, each a run of a whole top-level test folder. Most misses ran in worktrees that are gone, so the replay could not count their files. Against the governor before its review fixes, the only new refusals (41) run a whole tests/unit folder through a Git Bash path or a quoted path with spaces. Proved live on Claude Code 2.1.332.
jacked tests affected -- CMDRuns CMD on the test files of its language that import or read the change, one level deep, or under a changed conftest.py. Exit 3 and nothing run when it cannot choose: CMD names its own test paths, no base, a changed test configuration of CMD's language that no test names, or half the suite or more.Whoever the governor or the gate-cadence rule points at it.
jacked tests cap on (off by default)Sets PYTEST_XDIST_AUTO_NUM_WORKERS in settings env: half the logical cores by default (half the performance cores on Apple silicon). jacked uninstall takes back the value it wrote.Every pytest -n auto in every Claude Code session on the machine, wrapped or not.
jacked tests run turn (always on)One --kind full gate per machine: a second one fails at once with exit 75 and names the holder; --wait waits. When wrapped runs overlap, each gets the cores divided among them (or the cap, when lower); a run alone keeps the runner's default. A lock folder that cannot be used never stops the gate.The wrapped runs only (3 of 9,084 so far).
jacked tests loadThis report, on any machine, over the last 90 days by default.Measurement.
/test-diet slow-causes.mdThe four database causes (schema per test, truncate per test, one shared database, no pool) and the git repository per test, each with its repair.The suites, when Jack runs /test-diet.
Hook installer (#362)One settings entry per jacked hook and event; the copies are dropped on the next jacked install.Every jacked install.

Tasks

Not proposed

Decisions taken, for Jack to overturn


Generated with the jacked HTML artifact template.