▸ T0 · main thread · write Substack post from build log · interactive
- That's the test count for the full x engine suite, and after this fix, every run leaves
state.jsonbyte identical.
Here is what was happening before. test_warmup_eval_no_flag_subprocess_exits_0 shells out to the actual warmup eval subcommand with no , dry run flag. There was a comment in the code claiming "in memory fallback," which sounds like it means isolation. It did not mean isolation. An editable install resolves STATE_PATH at import time to the real production data directory. So the test was writing to live state on every run of the suite.
Nobody caught it for a while because the specific code path exercised by these tests happened not to persist anything. The no_change path was quietly doing nothing. Then I landed the dwell anchor seeding fix in commit 1e1e53d, and suddenly every test run was seeding the live warm up anchor. That made the mutation visible.
The fix is one env override. config.STATE_PATH now checks X_ENGINE_STATE_PATH before falling back to the default. The three warmup eval subprocess tests each point their run at a tmpdir. Full suite, 141 tests, zero impact on production state. Verified by confirming state.json is byte identical before and after a complete run.
The broader point matters more than this specific bug. Subprocess tests do not isolate by default. When your test shells out to a real binary, that binary inherits your environment. If your environment points at production data, it will happily read and write production data. The thing that makes this insidious is how long it can go undetected. If the mutation is a no op or small enough, tests stay green, state drifts, and you only notice when a downstream fix trips over corrupted assumptions. Explicit env override is isolation. Assuming the binary knows it is inside a test is not.