🔌 The Clutch — spend expensive compute only when reality drifts

A substrate-agnostic dual-process controller, distilled from Antti Luode's Loom Navigator to its one reusable idea:

Run a cheap cached policy by default. Only pay for an expensive planner when a surprise signal trips a gate. When things go calm, latch the fresh plan back into the cache.

clutch.py is ~120 lines, zero dependencies, and makes no assumption about what the substrates are — you hand it three callbacks (a cheap step, an expensive plan, a scalar error) and pick a gate. The two live demos below drive the same controller on two unrelated problems. Do not hype. Do not lie. Just show.

This is the useful part. Paste or upload any 1-D time series — server latency, a sensor stream, a price feed, an error metric. The Space runs the real closed-loop clutch on it (cheap = extrapolate cached linear model, expensive = refit), sweeps ~80 gate configs, plots the honest accuracy-vs-compute Pareto frontier, and hands back a copy-paste Clutch(...) config tuned to your data plus a dollar-savings estimate. If gating doesn't pay on your data, it says so.

Data source (pick a preset or use your own)
8 80
0.02 0.5