freecoding.school100% FREE · NO SIGNUP
The Seven LayersISSUE #72 of 73

routing & gating · the conductor switchboard

OMNIVSThe Silent Failure
OMNI saysThe conductor is a switchboard: it ROUTES each packet to the right specialist and GATEs the ones that should not run. It dispatches work — it never does work.

Fan-out (mol-64) assumes you already know which workers to spawn. Often you do not — the right specialist depends on the packet. That decision is routing: the conductor inspects an incoming packet and dispatches it to the worker whose role matches, the way a switchboard connects a call. Routing can be a simple lookup (intent → role), a classifier, or a rules table, but the conductor's job ends at the dispatch. It picks who acts; it never acts itself. That separation is what keeps the hierarchy clean and the conductor cheap.

The twin of routing is gating: some packets should not be dispatched at all — out of scope, over budget, failing a precondition, or destructive without approval. The conductor GATEs those before any worker is spawned, which is far cheaper than spawning a worker that immediately refuses. Route plus gate together make the conductor a true switchboard: every packet either reaches exactly one right specialist or is stopped at the board with a reason, and both outcomes are logged to the chain.

Power-ups you unlock

The Silent Failure attacks — common mistakes

Boss battleBuild a conductor that routes three intents to three roles, gates a fourth out-of-scope intent before spawning, and logs a reason for every decision.

Example code

<!doctype html><html><head><meta charset="utf-8"></head>
<body style="background:#06040d;color:#b388ff;font-family:monospace;padding:20px"><pre id="o"></pre>
<script>
const be = (layer, verb, payload) => ({ layer, verb, payload });
const ROUTES = { search:'scout', build:'builder', assess:'risk' };
const BUDGET_MAX = 10;
function conduct(pkt){
  // gate first — cheaper than spawning a worker that would refuse
  if(!ROUTES[pkt.intent])    return be('organ','GATE', { stopped:pkt.intent, why:'no route (out of scope)' });
  if(pkt.budget > BUDGET_MAX) return be('organ','GATE', { stopped:pkt.intent, why:'over budget' });
  // route to the matching specialist — the conductor never does the work
  return be('organ','PRESENT', { routed:pkt.intent + ' → ' + ROUTES[pkt.intent] });
}
const out = [];
[{ intent:'search', budget:3 }, { intent:'build', budget:4 },
 { intent:'assess', budget:99 }, { intent:'mine_crypto', budget:1 }].forEach(p => {
  const r = conduct(p);
  out.push(r.verb === 'GATE' ? 'GATE  ' + p.intent + ': ' + r.payload.why : 'ROUTE ' + r.payload.routed);
});
document.getElementById('o').textContent = out.join('\n');
</script></body></html>
▶ Open the interactive comic issue
‹ Tool Use As EXPRESS · Agents Reaching The Outside WorldThe Agent Chain · Committing Spawns & Retirements ›