Chapter 4 · agent-neuron · Lab
The alert storm
Forty invented alerts, three cheap detectors, one expensive call that runs only when two agree; the same storm run from code and from its file.
One storm, two commands
Forty alerts arrive for five invented services. Three cheap detectors (two shell scripts and a JavaScript file) flag what they see; a stand-in for a model call, one that waits 500 ms, runs only when two different detectors flag the same alert; and a composed neuron answers with the root cause. The recorded storm shows 17 expensive calls started instead of 40, ten of them cut short as stale.
The same storm runs two commands. demo:network is the storm from its network file, read and summed from its own run; demo:alerts wires the identical behaviour in code. A live run moves by milliseconds; the fixed numbers are the recorded one’s.
The rule it proves
The rules sit on the boxes, not in a controller: the costly neuron carries threshold: 2 and within: 500 on its own wrapper (SPEC 5.2), a newer alert for the same service replaces the older work (5.4), and the composed neuron is one node from outside, its inner network sealed (2.6). The whole network is one JSON file the engine validates and runs (2).
Run it
npm run demo:network # the storm from its file, summed from its own run
npm run demo:alerts # the same storm, wired in codeWhat it is not
Not a benchmark and not real traffic: the alerts are invented and arrive in bursts on purpose, the model is a timer, and nothing on the site plays that storm live.
