A nit session in single-pane mode: one agent, one mission, one terminal editor. The rest of the thesis unpacks what runs behind each turn of this chat; the encoders that score every save, the substrate that lets multiple agents share state, the swarm that turns one operator question into a fan-out of parallel proposers, and the multi-pane mode that lets one operator run sessions like this one in parallel.
→ nit.tools — install, docs, and screencasts
The year 2026 is an exciting time for programmers, scientist, founders and the entire human race. It’s the year humanity witness a new being, AI, emerge into the digital world, one that works at the speed never thought of before. One of the advances that is visible is the emergence of frontier class AI agents which reliably ship code that compiles, type-checks, and passes tests on demand. A lot of the time, these agents ship code that is correct and they are getting better and better at shipping correctly functional code. This is great and we should celebrate it at any chance we get but there is a catch: the agents produce absolutely terrible code, structurally so to speak. This is a huge problem and it is becoming more and more frustrating as many entities use agents to do almost everything that involves writing a piece of code. Before agents, humans had invented test suites that rewarding functional correctness, linters for catching local code smells, code reviews that reward style and taste, but in the world where agents are part of the process, none of these methods produce a per-turn(because agents run in turns or in a loop) signal an agent can score, optimise, or train against. This becomes inherently hard to fix the structural quality problem since the agents are still not “smart” enough. We think the missing piece is a fitness function for structural quality --- one that grades whether the code holds up: clean abstractions, shallow nesting, balanced complexity, names that load-bear, modular function boundaries --- the kind of structure that survives a refactor and rewards re-reading. We think we might have this fitness function. This post presents nit, a terminal-first editor and agent station built in Rust, and the central thesis it instantiates: structural quality is observable as dynamic behaviour. We encode a source file’s syntax tree as a seed for Conway’s Game of Life, run the simulation, and watch what survives. Files with well-distributed token entropy, low cognitive complexity, modular boundaries, and balanced AST depth produce organisms -- long-lived oscillators, spaceships, methuselahs, and (rarely) replicators. Deeply nested, monolithic, or comment-bloated files produce blobs that collapse within a few generations. The behaviour tier becomes the fitness signal we look at. The thesis develops the encoding pipeline, four AST-driven encoders, a soft-bottleneck aggregation rule, and a parsimony layer that prevents the score from being satisfied by over-engineering. The infrastructure section then explains why a fitness function alone is not enough: an agent must see it, retry against it, and coordinate around it. We describe nit’s living-system architecture --- a stigmergic substrate, a DAG-based swarm orchestrator with auto-repair, a hidden intake classifier, and a shadow pipeline --- then close with results from real codebases, open questions, and an invitation to try it.

The Problem: Compiles, Passes, Decays

In this section, we will walk through the main problem and why we think it’s a major problem. The problem started in 2022 when models were doing what most people have now almost forgotten; hallucinating. This became a curiosity for researchers and over the years, the symptoms have been disappearing slowly. Now, in 2026, we seem to almost not see it in frontier models as often and due to this, they have become reliable instruments for humans to use in their everyday life. Take coding for example. agents write code that works: compiles, type-checked and ready to ship on demand. Everyone is coding and shipping faster everyday in matter of hours. This phenomena gave birth to what we now call “vibe coding” where a person, sometimes without deep domain knowledge, drives one or more agents through a working artifact in conversational style(throwing messages at each other back and forth). What started as a trend in the software development world turned to be the most dangerous thing for the software ecosystem(we think).
One issue we see --- anyone who uses AI models has experienced this --- is that the default of an LLM, given a prompt, is to append. When faced with a bug, it adds a guard rather than fix the precondition; faced with a new requirement, it bolts on a branch rather than rework the abstraction underneath. Imagine you are running many turns. The end results for such many turns is the files swell with dead code, modules accumulate scaffolding for cases that no longer exist, and the cognitive surface a future reader/coder has to hold in their head grows without bound(reading spaghetti code is not pretty at all; try it). The result: people complain online about not understand code produced by AI agents or build software they do not understand how it works. But with such power, producing code faster, comes a new kind of problem; “AI slop”
This term emerged to refer to the results produced by doing vibe coding: software that exists, that fits a description, that does a thing, but that nobody actually understands. It compiles, passes tests, and decays really fast. These are two problems that requires more attention because they create a major problem in the software ecosystem or the internet: the population problem. Each piece of slop-ware that ships becomes someone’s dependency, reference, or training corpus. When a replacement is needed, which is always the case with slop-ware because of the survivability problem of this systems, the cheapest path is to prompt another into existence in an afternoon indistinguishable from the original in structure and in fate. The trajectory is not toward fewer software systems but exponentially more, each shorter-lived than the last one. As the saying goes(invented by Claude); “plenty without maintainability is congestion”.
What separates code that lasts from code that decays is not compilation or test pass or functionality; those are surface measures the models have mastered. It is structure: shallow nesting, balanced complexity, modular boundaries, identifiers that load-bear, abstractions that don’t paper over the problem they model. Style guides reward style; linters flag local smells; reviewers catch what they remember. None of them produce what the AI-generation regime needs: a per-turn structural signal an agent can see, score against, and learn from.

The Thesis: Code as Dynamic System

Structural code quality is observable as the dynamic behaviour of a cellular automaton seeded from the source AST.
Static measures that already exist, which have been extensively studied and used for many years, are cyclomatic complexity, AST depth, token entropy, and identifier uniqueness. The style guides is one of the use cases that humans invented to use these static measure methods. They also have built within systems ways to measure code based on these methods. From this, humans have defined or understood what to them means beautiful/good code and it usually means the interaction of them --- balanced, modular, parsimonious, expressive -- which no single static number captures. The hypothesis is that this interaction can be made observable through an encoding scheme that borrows from computational systems: encode the static structure as a cellular automaton seed, run the rule, and the resulting trajectory is a fingerprint of how the axes hang together.
Conway’s Game of Life is the substrate we chose. Three production rules, two cell states, and a well-studied phenomenology -- still lifes, oscillators, spaceships, methuselahs, replicators -- give us a tier ladder that is legible to humans and observable from a trajectory. The problem with this is that we cannot quite get the Conway’s Life like phenomena just from characters in a piece of code to measure actual quality, so we use it instead as a transducer that turns each inspector’s reading into a comparable number(usually within a margin we choose or in future let the system adapt). Balanced initial conditions produce diverse, identifiable behaviour; skewed conditions (too dense, too sparse, banded) collapse within a few generations. That symmetry is the signal, the same property that makes Life famous makes it a discriminator.
Life is not the only viable CA. Elementary rules 30, 90, and 110 would each carry structural information from a seed; Wolfram’s principle of computational equivalence suggests that simple programs can capture rich structure in systems far more complex than themselves. We chose Life because its attractor library is named, taught, and visible at a glance -- when the fitness signal has to teach an agent, readability of the tier ladder matters as much as its discrimination but we cannot rely on the ladder for quality measures, so we introduce other factors(which we will talk about) to boost our fitness function.

Illustration: random seed vs structured seed, 200 generations

Random seed at density 0.31 -- Life’s sweet spot for diverse, non-collapsing dynamics and structured seed: an R-pentomino centred in a 64x64 grid, a famous Methuselah that lives 1103 generations and ends with 116 cells in 6 escaping gliders. Below(on the left) a random seed and (on the right) an structured initial seed.
Out[]=
After running many generations of the above seeds using the same rule, we find the plot below which shows live cells per generation under Conway’s Life from a random seed (gray) and an R-pentomino (blue).
Out[]=
random
structured (R-pentomino)
Here’s after generation 500 of the same rule : random' s stable noise floor of still-lifes and a few oscillators (left) versus the R-pentomino' s late-decay chaos and escaping gliders (right). We used different structural starts, same rule, but got different structural ends.
Out[]=

The Encoding Pipeline

The thesis is implemented in five stages(figure below). What happens is a source file walks through them once per edit and emerges as a Conway’s Life seed:
Out[]=
Editor text
Raw bytes from the open file
↓
Encoder
7 methods, 4 scored, 3 display
↓
Value grid
0-255 intensity per cell
↓
Jitter
Pseudorandom ±32 variation
↓
Threshold
Density-based alive/dead cutoff
↓
Symmetry
mirror-x, mirror-y, or rotate-180
↓
Simulation
Conway's Game of Life runs
Once edits are made to a file(usually code), the encoder reads the source file the edits were made and produces an image-like 2D matrix where each cell carries an intensity value between 0 and 255. Think of it as converting code into a grayscale picture where brightness encodes some property for Token Spectrum which is the role a token plays, property for AST Structure which is the depth/shape signature, etc. Different encoders project the file onto different axes, but they all output the same grid shape.
The jitter adds a pseudorandom perturbation to every cell right after the encoder completes its job, with the random seed derived from the file content itself. Two outcomes might happen: (a) the same file always produces the same jittered grid (reproducibility), (b) artificial regularity in the encoder output gets broken up. Without jitter, a file with very regular structure (long similar functions, uniform tokens) would produce a regular striped/banded grid, which is dead in Conway’s Life.
I mentioned above that we choose the values our encoding scheme to play with and also touched on the fact that this can be down adaptively. For now, we do it manually where we take each cell to have a value between 0-255, and we know Conway’s Life needs binary alive/dead. The easiest way to this path is to pick a fixed cutoff like “value ≥ 128 → alive”. The nit way is to pick the cutoff so that exactly 31% of cells end up alive, regardless of the underlying intensity distribution. This makes the rule adaptive in a sense that a darker file gets a lower cutoff, a brighter file gets a higher cutoff, and both land at the same density. Why .31? Conway’s Life is most dynamically interesting in the 0.2-0.4 density band; below 0.15 cells die of isolation (Life’s survival rule needs 2–3 neighbours), above .45 they die of overcrowding. 0.31 sits in the sweet spot where gliders, oscillators, and the other interesting patterns can emerge.
After applying the threshold you’ve got a binary grid that you can apply the symmetry step by folding the grid onto itself. In biological terms, we use terms like bilateral which means mirror-x or mirror-y: take the grid, take its mirror and union them (a cell is alive in the output if it’s alive in either) and radial which means rotate-180: union the grid with its 180° rotation. The reason for these is (a) real biological/physical systems exhibit bilateral or radial symmetry so that the symmetry transform pushes the system towards biologically plausible patterns, (b) the agent has to read the final pattern; what survived, what died, what oscillated and symmetric patterns are easier to recognise than asymmetric.
Each stage is load-bearing meaning without an encoder, the file carries no structural signal; without jitter, the encoder’s deterministic output bands and produces degenerate Life; without the threshold, continuous values cannot seed a two-state cellular automaton; without symmetry, chaotic seeds rarely settle into attractors a human or an agent can name are see. The encoders themselves, where structural quality actually gets measured, are the subject of the next section.
Here are visual examples of the results of applying grid selection, threshold and symmetry in that order just from raw bytes.
In[]:=
SeedRandom[42];​​With[{n=32},​​Module[{bytes,rawByteGrid,valueGrid,jitter,jittered,threshold,binaryGrid,finalSeed},​​bytes=Take[PadRight[Import[encoderSource,"Byte"],n*n,0],n*n];​​rawByteGrid=Partition[Take[PadRight[Import[encoderSource,"Byte"],n*n,0],n*n],n];​​valueGrid=Map[byteCategory,rawByteGrid,{2}];​​jitter=RandomInteger[{-n,n},{n,n}];​​jittered=Clip[valueGrid+jitter,{0,255}];​​threshold=Floor[(1-0.31)*255];​​binaryGrid=UnitStep[jittered-threshold];​​finalSeed=MapThread[BitOr,{binaryGrid,Reverse[binaryGrid,2]},2];​​GraphicsRow[{​​encoderPanel[rawByteGrid,"raw bytes"],​​encoderPanel[valueGrid,"value grid (0–255)"],​​encoderPanel[binaryGrid,"post-threshold (ρ=0.31)",True],​​encoderPanel[finalSeed,"post-symmetry (mirror-x)",True]​​},​​Spacings->30,​​ImageSize->Automatic​​]​​]​​]
The same 1024-byte slice of a Rust source file walking through the four-stage pipeline: raw ASCII, then encoded into semantic intensity bands, then binarised at density 0.31, then folded with mirror-x --- the seed that gets handed to Conway’s Life.

The Four Scored Encoders

Let’s walk through the four encoders that feed the genome score. Each is a different view on structure, and together they form a multi-axis fitness function. Three additional byte-level encoders ship with nit but are explicitly excluded from scoring because they are bytes that only add noise to the system and we do not want noise at all so these are designated for visualisation and we will not talk about them here either.

Token Spectrum

This is the default encoder. Tree-sitter classifies every byte of source by its semantic role --- whitespace, comment, punctuation, operator, keyword, variable, type, literal, function name, macro --- and each role maps to a distinct value band. Byte values are then chunked and averaged into the 1024 cells of the 32 x 32 value grid or 64 x 64 depending on the size of the file via a Hilbert-curve mapping that preserves locality across the file.
Anti-gaming: well structured code has balanced category distributions across the bands. A pure comment file produces an all dead grid; a no comment file collapses from over-density. You cannot win by tilting the distribution toward any single category.

AST Structure

This uses a depth-first traversal over the named AST nodes. Each node’s cell value combines four structural properties: nesting depth (30%), child count (25%), byte span (25%), and a hash of node kind (20%). Nodes occupy cells proportional to their byte span, then Hilbert-mapped.
Anti-gaming: deep nesting and long functions produce dense blobs that collapse under Conway’s rules. Modular code with shallow nesting and short functions produces separated components that sustain.

Complexity Field

This is the most rigorous of the four encoders. Four signals are combined per-line metrics, they are AST nesting depth (25%), per-function cyclomatic complexity (30%), token entropy (25%), and identifier uniqueness (20%). The grid is laid out spatially --- y-axis is line number, x-axis is column --- so the rendered seed reads as a heatmap of the file’s complexity.
Anti-gaming: a high tier requires low complexity, high token entropy, unique identifiers, and moderate nesting, all at once. Optimising any single axis hurts the others.

Structural

The Structural encoder is a catch-all encoder. It strips whitespace and then looks at the surface of the file in four cheap ways. The first is how much character variety each local stretch has (35%). The second is how deep the brackets and parentheses go (25%). The forth is what mix of letters, digits and operators each region contains (20%). And lastly, how much short-string repetition the file has (20%). The four numbers get blended into one. It is dumber than the encoders that parse a full syntax tree,, smarter than ones that just count raw bytes, and its job is to catch tricks the syntax tree encoders miss, i.e., code where every variable is renamed to a single letter, code where the same block is pasted ten times, code where the punctuation pattern is unusual. Two copy pasted blocks produce identical syntax trees but very different surface texture, and Structural is the encoder that notices the difference.
Note: the file source used here is already a well-structured Rust file with very few entropy anomalies. The file was written using nit’s system.

The Fitness Function: A Tier Ladder

During agents run or work, they continuously evaluate their code against a fitness function that produces a “genome” report which acts as feedback to the agents. This creates a feedback loop that agents can learn and continuously improve themselves. The genome score produced has to collapse each run’s trajectory into a single tier the agent can read and retry against. Note that the tier is not what the agents sees, it’s nit’s label to what they see.
Each encoder run records three things from the Life simulation: how many generations the seed produces any live cells, the trajectory of live cell counts over time, and the density trajectory. These three signals are what the tier match runs against.
We have five tiers, each named after a class of dynamic behaviour Conway’s Life is famous for, rendered with their canonical patterns:
A file’s tier is the minimum across the three AST-driven encoders -- Token Spectrum, AST Structure, Complexity Field -- with a capped lift from Structural and from cross-encoder consistency. The bottleneck is the anti-gaming guarantee, winning on one encoder cannot lead another to collapsing. If Token Spectrum reads Replicator but complexity Field reads StiffLife, the file becomes StillLife.
A separate consistency score asks whether the four encoders agree on what they’re seeing. High agreement means the tier is trustworthy. Low agreement means the file is doing something one encoder isn’t measuring well.

The fitness signal at work

We scored four states of the same algorithm under nit’s system: (1) lexcographic.py as originally written 4 years ago, (2) lextest.py, a rewritten version by an agent (outside of nit) that collapses the five algorithms into one mega-function with single-letter variable names and no docstrings, (3) lexcographic_refactered.py after nit’s agent refactored it according to the recommendations from state (1), and lextest_refactored.py after nit’s agent refactored it from state (2). The starting tiers are II and II; both refactors land at III. The encoder breakdown is where the meaningful differences live, including a striking range of cross-encoder consistency (0.29, 0.33, 0.84, 0.53) that reveals two refactors of unequal quality even though they share a tier.
The grouped bar chart below shows generations_survived per encoder for each of the four states, taken straight from the four genome JSONs. The two pre-refactor states sit on the left of each group (gray and red); the two post-refactor states sit on the right (green and teal). The pre-refactor pair shares tier II but bottlenecks from different directions: Token Spectrum for the original, AST Structure for the bad rewrite. The post-refactor pair shares II, both via a Token Spectrum/AST Structure floor in the 266-275 range. nit’s agent split the bad rewrite’s mega-function (38 cyclomatic, 140 cognitive) into nine smaller functions; it extracted two helper functions from the original’s 78-line lexico_permutations_fast.
The grid below pairs the headline diagnostics across all four states, read from the four genome JSONs. Reading down the columns gives the per-function shape of each state; reading across each row shows how that single dimension responds to each transformation.
The four column grid tells a story the tier digit alone cannot. Both refactors clear the same threshold (II  III), eliminate the critical recommendation (1  0), and pull worst-function complexity down sharply (cognitive 48/140  11/17; cyclomatic 19/38  6/9). The cross-encoder consistency row shows lex jumping from 0.29 to 0.84, the four encoders, which previously disagreed, now strongly agree on what they’re seeing. lextest jumps from 0.33 to only 0.53, the encoders agree more than before but still hold meaningfully different readings. Both files are tier III; one is a confident III, the other is a borderline III. This is the signal we want: a fitness function that rewards genuine restructuring (II  III on both refactors) and surfaces the quality difference between the two refactors in cross-encoder consistency rather than burying it in a single tier digit.

Function-Level Scoring

Function level is like the information layer, agents need to know things, they need to be pointed at specifics and nit does that in a way that is naive for works. It uses per-function metrics to surface the worst offender so the agents know exactly which function to refactor, if you doing a refactor. Every function in the file gets four numbers:
◼
  • Cognitive complexity (SonarSource-style) counts every branch in the function(if, while, for, try, switch ...) but charges more for branches buried inside other branches. Two if statements at the top level cost less than two if statements nested inside each other. The metric assumes deep nesting is harder to read than shallow nesting and prices it accordingly.
  • ◼
  • Cyclomatic complexity just counts the branches and posses no penalty for where they sit. It is kept alongside cognitive so we can compare. If cognitive is much bigger than cyclomatic for the same function, the branches are stacked deep inside each other rather than laid out flat --- that gap is the hidden nesting cost cognitive picks up and cyclomatic misses.
  • ◼
  • Max depth is how far down the function nests at its deepest point. An if inside a while inside a for is depth 3. One number, the worst case in the function.
  • ◼
  • Node count is how big the function is, measured by the parser. Counts the real parts of the code (statements, expressions, declarations); not raw lines, not comments, not whitespace. Just the parser’s view of side.
  • Function scores are sorted by cognitive complexity descending. When the top entry crosses SonarSources’s “very hard to follow” threshold (around 25 cognitive), it becomes a targeted recommendation appended to the agent’s retry prompt. The agent doesn’t need the file’s tier to know what to do; it just needs to know which function to look at first. The function level scoring is the dispatch layer that feeds this information to the agent.
    Below is the top of the per-function output for nit’s own crates/nit-tui/src/claude_runner.rs (99 functions total, tier III Spaceship, cross-encoder consistency 0.47). Three functions cross the Critical cyclomatic threshold and get split recommendations appended to the agent’s retry prompt; the rest get warnings (identifier-uniqueness, nesting-depth) or no recommendation.
    The three Critical recommendations target the same path in the file: long functions with many branches. An example of this in our file in question is runner_loop at 290 cognitive (60 branches, depth 26) is the file’s structural debt concentrated in one place. Splitting it would lift the file’s cross-encoder consistency by reducing the AST Structure encoder’s outlier readings on that block. Tier-level metrics tell you the file is at III; function-level metrics point at the function and tell the agent what verb to use.

    Anti-Gaming: The Parsimony Detector

    Of course there has to be a layer that prevents gaming because agents are very good at gaming the system. For that purpose, we have the parsimony detector. This is nit’s regulariser, the anti-cheat. Any score can be gamed, and the most predictable cheats against a code quality score are cheap structural tricks like splitting the code into lots of tiny near empty functions, padding the file with comments, pasting the same doc header above every declaration. Parsimony watches for exactly these cheats. If a file has 15 or more functions averaging under three real lines, or comments take up more than 40% of the file, or 12 or more functions are at least half tiny (5 lines or fewer), or doc header lines repeat across declarations, the file’s tier is capped at IV (Methuselah). Tier V (replicator) is therefor unreachable through all these cheats. This is nit’s strongest answer to the “metric goes wild”.

    Why a Living System: The Substrate

    A fitness function is useless if the agent can’t see it, the swarm can’t share it, or the work can’t persist between runs. In nit, we have a subsystem we call the substrate that handles shared, durable, typed state. All activities of agents is kept here.

    Data model: .nit/substrate/state.json

    We have four kinds of records we keep in the substrate/environment:
    ◼
  • Signals are traces of work that happened or was attempted by agent(s). They are DoneMarker, Warning, ClaimViolation, HelpNeeded, Lead, and Deadend. Each signal has a strength that fades over time and once it drops below 0.05 it’s deleted.
  • ◼
  • Claims are an announcement an agent makes so other agents know what it’s up to. Kind of like “I’m going to write this file” but not literal as this. Each claim names the path, the kind of access (ExclusiveWrite, SharedRead, AppendOnly, Soft), and how long it lasts in turns. If two agents try to claim the same path in conflicting ways, the system picks one.
  • ◼
  • Assumptions: “I’m doing this work assuming file F currently looks like X” markers. If another agent later writes to F in a way that breaks the assumption, the assumption is automatically marked invalid and a Warning lands in the original agent’s inbox so it can recheck.
  • ◼
  • Mood is a global mode flag with three settings (Exploration, Consolidation, Defensive). It switches automatically based on how much warning and conflict pressure is in the system, and it doesn’t flip back immediately. Mood speeds up or slows down the heartbeat, the decay, and how aggressively conflicts get handled.
  • Stigmergy as the design pattern

    Borrowed from the idea of ant colony, this mechanism allows agents to indirectly coordinate with each other in a shared environment. In nit, agents talk by leaving traces in the environment or substrate, not by sending each other messages like we might expect in other systems. There is no agent-to-agent chat, no shared chatroom, no agent registry. The colony emerges from the traces as opposed to conversation between agents. The closes natural agents that use this design are Termites where they coordinate by reading and modifying the nest they’re building. To them directly signaling is not possible. The biological word for it is “stigmergy” (Grassé, 1959) and nit uses it for AI agents to perform coding tasks.
    Pure stigmergy doesn’t work for LLM agents, though. Termites get noise and scale for free as there are thousands of them and they make small, cheap moves. LLM agents are the opposite, they are few, expensive, and prone to getting stuck in loops. So nit adds a few deliberate overrides on top of the trace-based design: explicit tiebreaks, assumption tracking, structural arbitration. They give nit what nature gives termites through sheer numbers (this is a hack). The substrate is the trace medium, the Arbiter(below) and Resolver roles are the explicit overrides.

    Four coordination roles

    ◼
  • Worker: this does the actual work. Reads signals and claims to decide what to attempt, then writes signals when something completes or fails.
  • ◼
  • Observer: this watches patterns across the whole substrate and emits meta-signals when something looks off (e.g. “thrashing detected”, “two Workers writing the same module”).
  • ◼
  • Arbiter: this steps in when conflicts persist. Revokes claims, weakens signals, raises mood to Defensive.
  • ◼
  • Resolver: this commits the agreed state to the real world, that is, writes the git tree, edits the filesystem, runs the tests.
  • Metabolism

    This is a real-time heartbeat (5 seconds by default, faster or slower depending on mood) drives the substrate forward on each tick. It expires claims whose TTL ran out, prunes signals that decayed below the threshold, runs Observers and Arbiters in a fixed order, and reevaluates mood based on recent pressure. The heartbeat is not optional and it does not pause. It runs even when no Worker is active which means the substrate has its own clock and can decay or recover even with no agents present. That is the literal sense what we mean by nit is a living system, not a coordination tool.

    The architecture in one figure

    The substrate sits at the center. The four coordination roles surround it as actuator arms; metabolism is the heartbeat that drives the whole system forward each tick; the fitness function is the judgment lens that scores any work the substrate records. Six arms, one shared core.

    Swarm Orchestration

    This is the single most valuable feature in nit for anyone interested in running a true orchestration of agents. A single mission say “refactor the auth boundary” does not become a single agent prompt but a directed acyclic graph of agent turns that converge on a single result. This section walks through the lifecycle of how the DAG is planned, validated, dispatched and gated. Then it goes on to how the fitness function from the preceding sections becomes a per turn judgement inside the loop.

    The plan cycle

    Every mission flows through five stages connected by retry loops. The planner reads the mission statement or user prompt and produces a DAG where the nodes are agent turns and edges are dependencies. The fan out dispatches N proposer turns in parallel depending on the planners artifact. To converge, the judge or synthesiser acts over the proposer outputs, picking one or merging them. Integrator is the sole writer; it writes the chosen result to disk through a single or multiple in parallel writers. Verify role runs the test gates and the genome score against the resulting state. Both integrate and verify can trigger a retry back to propose if their gates fail or the genome quality drops between turns; only persistent failures escape the loop. During retries, the proposer do not come up with another proposal but revisits their initial proposer to verify the writer did the job right and flag out the reason for the failure which is then dispatched back to the writer.
    The diagram is the shape of the lab and bulk templates(see below), the two that go through one writer. The section between Plan and Judge is where the swarm does its parallel work: N agents propose without seeing each other, and the judge sees all of their artifacts at once. Only one agent writes the result, which keeps the others from stepping on each other. The parallel template looks different: it lets several agents write at once when their work doesn’t overlap(although this never happens with the substrate system that allows agents to claim files). The two dashed loops are the consequences: if Integrate fails its gates or Verify catches a quality drop, the cycle goes back to Propose and tries again, instead of letting bad work slip downstream.

    Three templates

    We have 3 templates in nit. A template is a tag or a label that is given to a mission to guide how agents should be assigned and run. The three named templates shape the DAG itself during a mission. These are:
    ◼
  • Lab: this is the default. Many agents look at the code and write up findings or proposals, but only one designated agent (the integrator) actually edits files. Used when you want options explored before committing one answer.
  • ◼
  • Parallel: the mission splits into independent pieces that don’t share files. Each agent owns one piece and writes its own output. Several agents can write at the same time because their work doesn’t overlap but if they did, the observer in the substrate system will catch it. Used for jobs like “document modules A, B and C in parallel or doing refactors”.
  • ◼
  • Bulk: many agents write competing candidate solutions in parallel (actual code, not just suggestions). One judge agent compares them and picks or merges the best. One writer agent commits the chosen result. Used when you want to try several ensemble approaches and let the best one win. This is borrowed from the idea of "bulk orchestration" from Stephen Wolfram’s work.
  • Mission focuses

    We also have missions in nit. Every mission has a focus that adjusts the planner prompt. Three values are used to specify missions. These includes, general (the default), research (investigative work where the output is understanding, not code) and computation-research (code-as-experiment, e.g. spawning a tier-comparison run across a corpus). The focus changes which prompts the planner reaches for. The template is useful here because it changes the DAG shape.

    Validation before dispatch

    Before any worker runs, the planned DAG passes through a small validator. Three checks happen, (1) single-writer enforcement i.e., exactly one node in the DAG is allowed to write files (the integrator); others propose but do not commit, which prevents the most common multi-agent failure mode of concurrent writes to the same path, (2) cycles in the DAG are rejected outright and the planner is asked to re-plan, (3) missing dependencies (a node referencing an output no node produces) get auto-repaired by a small validator and repair pass that inserts the missing node or removes the edge.

    Genome score in the verification gate

    The fitness function (tier ladder, function level scoring and parsimony detector together) is not a one-shot diagnostic, it runs inside the verification gate per turn with consequences. A quality drop (the tier going down between turns) triggers genome retries and the responsible party(writer) for the failing files is asked to try again up to three times per write. After five clean turns the bar climbs one tier on the ladder; StillLife  Oscillator  Spaceship  Methuselah  Replicator and the standard tier becomes the new minimum. A degraded turn isn’t flagged but costs the agent another attempt.

    Shadow Agents and Intake Classification

    When running single turns, it turned out that agents did not get the full context of the project you are running them on and most of the time they don’t do so well on their task. To solve this, we added an extra layer under single agent missions to run shadow agents(proposer_a, proposer_b, judge, reviewer and the main agent) to assist to augment the user prompt. This feature is triggered when a prompt looks heavy i.e., longer than 500 characters, or containing keywords like “refactor”, “rewrite”, or “implement”. If any of these agents fails, the main agent is re-dispatched with the original prompt untouched, so the user always gets an answer even when the heavy machinery breaks.
    nit also has a separate hidden preprocessor that runs once per prompt, but only when writer is a Claude-class lane. It is a single Claude-class LLM call that classifies the prompt’s intent as read, write, mixed, or conversational. On writes it appends a non-negotiable FILE CHECKLIST to the prompt before dispatch, on reads the agent gets the prompt untouched.
    The reasons for skipping the classifier when Gemini or Codex is use are, (1) the classifier prompt was written for Claude’s response style; it expects strict JSON output that Claude follows reliably but other models often don’t, so the answer can’t be parsed, (2) the timeout is calibrated for Claude haiku’s sub-second speed; Codex and Gemini are slower, and a timed-out call still burns a full reasoning turn’s worth of compute for nothing.

    Multi-pane: N Independent Agent Sessions

    What it is

    A lot of times you want to spin up multiple sessions to run your agents. Currently, people do this using many terminals to act as different sessions. What nit does, it ships a tmux style that launches many pane in one terminal. Each session is independent and operator can select which project to run for each pane by using nit’s built in directory searcher. Command to launch this is: nit multipane --panes N, where N is the number of panes, say 16 in the case below.
    A 4×4 nit’s multi-pane session. Each of the sixteen tiles is its own chat with its own working directory(switchable by the operator), context, and mission; all running concurrently in one terminal.

    Why it matters

    Working with a single agent is mostly waiting. You type a request, the agent goes away to think for a few minutes, and you watch the screen until it comes back. Multi-pane removes the wait. While pane 1 is working, you set up pane 2; while pane 2 is working, you answer the question pane 1 just sent back; by the time you reach pane 4, pane 1 is ready for its next round. The slow thing stops being the agent and becomes a matter of how many things you can keep track of at once.

    Open Questions / Future Work

    The open questions below are where the design has gaps and hopefully where the next experiment, the next reader, or the next contributor might help with the answer.

    Computational phylogenetics for code

    First is this idea of phylogenetics in biology; the study of evolutionary history of life. In nit, every commit produces a genome, i.e., a structural fingerprint of the file at that moment. When strung together across a repository’s git history, the commits trace a tree of genomes the same way species trees trace biological evolution. The questions that can be explore here would be, (1) what does that tree look at scale and can it be visualised?, (2) can we detect speciation, that is, the moment a codebase forks into distinct subsystems that no longer share structural patterns from the genome trajectory alone?

    Encoder inversion

    By default, the encoders run forward where source code comes in, binary seed grid comes out. The reverse direction is an open question. Given a target seed pattern, say, a grid that produces a known long-lived pattern under Conway’s rules, can we generate source code that, when encoded, lands on that exact grid. Think of it like a target conditioned generative model that writes code by construction to hit a target tier, rather than by refactoring up to it.

    Mood as a structural variable

    We have, currently, three moods(Exploration, Consolidation, Defensive) that the substrate runs in, and mood scales the metabolism rate. At this point, mood do not show up in code as state for agents to see but one question we could explore is does it leak into the code itself, and can it? The hypothesis is that code written under Defensive mood (slower tempo, longer claim leases, less concurrent work) ends up structurally different from code written under Exploration. Well, this is more a model based question than it is nit’s but nit could play a role of a feedback machine to agents to share the mood at that moment. And if this question is true, the difference should be visible in the genome trajectory across mood transitions which would make mood not just a coordination knob but a measurable variable that shapes the output and how agents learn.

    Cross-language calibration

    There are quite a lot of programming languages as of the year 2026 and more are being invented every now and then. What is also exciting is that nit can support the major languages especially passing through the encoding scheme the encoders use. For example, in nit, encoders need to sort every token into one of four buckets: keyword, operator, identifier, or literal. But each language has different keywords and different operators. Python’s def is Rust’s fn, TypeScript uses function and arrow syntax, and so on. So nit keeps a separate lookup table for each language. The tier a file ends up at depends on which table was used to score it. A tier-III Python file and a tier-III Rust file are both rated by their own language’s rules. One open question is can we adjust the tables so that tier III means the same level of structural quality across Python, Rust and TypeScript? Or is tier always relative to one language and trying to compare across languages may not have a clear answer?

    The Replicator floor

    This is an unreachable tier in practice for short files because there isn’t enough seed density to produce the long-lived, propagating patterns that earn the Replicator label. An open question is whether we can engineer rule variants that have different density thresholds, different symmetry transforms, different grid sizes, etc, where Replicator is reachable for short files as well.

    Alternative rules

    We currently use Conway’s Game of Life as the substrate for the fitness function but what happens if we replace it with one of Wolfram’s elementary cellular automata rule, i.e., rule 30 (chaotic), rule 90 (Sierpinski fractal), or rule 110 (Turing-complete with a different attractor structure)? Does the tier ladder still produce a useful signal or does Life’s specific mix of still lifes, oscillators, spaceships, methuselahs, and replicators do the load-bearing work?

    Adversarial encoders

    The parsimony detector defends against known cheats (mass-splitting, comment padding, doc-header cloning). What does an agent that’s explicitly trying to fool the fitness function look like, one that knows the encoder pipeline and writes source code engineered to land at a high tier without producing actual structural quality? Is parsimony sufficient against a deliberate adversary, or does the next iteration need a meta-detector that watches for unusual gaps between fitness score and conventional measures of quality?

    Conclusion

    A note on novelty: as far as we can tell, no prior tool, linter, or evaluation framework reduces structural code quality to cellular automaton survival. So this is part proposal, part experiment. We do not yet know whether generations survived holds up, at scale, as a stand in for what experienced engineers call good code. What we have witnessed with nit is a combination of the following items:
    ◼
  • A new fitness function for code, behaviouraly defined via Conway’s Game of Life. The first per-turn structural signal an AI agent can be trained against.
  • ◼
  • A living-system architecture that closes the loop: agents see the signal, retry against it, and coordinate around it through stigmergic traces rather than direct messages.
  • ◼
  • Open source, distributed via download.nit.tools. Three swarm templates (lab, parallel, bulk) inside one terminal-first interface. Built in Rust with #[forbid(unsafe_code)] across the codebase.
  • Try it

    macOS, Linux, and WSL:
    curl -fsSL https://download.nit.tools/install.sh | bash
    Windows (PowerShell):
    irm https://download.nit.tools/install.ps1 | iex
    Then run nit to start a single session, or nit multi-pane to open the grid. Docs and screencasts at nit.tools.

    References and Further Reading

    ◼
  • Conway, J. H. (1970). The Game of Life. Communicated via Martin Gardner, “Mathematical Games --- The fantastic combinations of John Conway’s new solitaire game ‘Life.’” Scientific American 223 (October 1970): 120–123. https://conwaylife.com/wiki/
  • ◼
  • Berlekamp, E. R., Conway, J. H., Guy, R. K. (1982). Winning Ways for Your Mathematical Plays, Vol. 2. Academic Press. (Source for the tier-pattern vocabulary: still life, oscillator, spaceship, methuselah, replicator.)
  • ◼
  • Wolfram, S. (2002). A New Kind of Science. Wolfram Media. Esp. chapters 2–3 on simple programs and chapter 12 on computational equivalence.
  • ◼
  • Wolfram, S. (1984). “Universality and Complexity in Cellular Automata.” Physica D 10:1–35. (Four-class taxonomy of cellular automaton behaviour: stable, periodic, chaotic, complex.)
  • ◼
  • Cook, M. (2004). “Universality in Elementary Cellular Automata.” Complex Systems 15(1):1–40. (Rule 110 universality proof, relevant to the alternative rules open question.)
  • ◼
  • Wolfram, S. (November 2025). “What’s Special About Life? Bulk Orchestration and the Rulial Ensemble in Biology and Beyond.” Stephen Wolfram Writings. https://writings.stephenwolfram.com/2025/11/whats-special-about-life-bulk-orchestration-and-the-rulial-ensemble-in-biology-and-beyond/ (Bulk orchestration as a property of living systems, and the rulial ensemble framing for what “life-like” dynamics actually picks out among the space of possible rules --- directly relevant to nit’s bulk template and to the alternative-rules open question.)
  • ◼
  • McCabe, T. J. (1976). “A Complexity Measure.” IEEE Transactions on Software Engineering SE-2(4):308–320. (Cyclomatic complexity, the basis for nit’s cyclomatic metric.)
  • ◼
  • SonarSource. Cognitive Complexity: A new way of measuring understandability. Whitepaper, sonarsource.com. (Basis for nit’s cognitive-complexity scoring.)
  • ◼
  • Grassé, P.-P. (1959). “La reconstruction du nid et les coordinations interindividuelles chez Bellicositermes natalensis et Cubitermes sp.: la théorie de la stigmergie.” Insectes Sociaux 6:41–80. (Original stigmergy paper.)
  • ◼
  • Proc Natl Acad Sci U S A. 2016 Jan 19;113(5):1303–1308. “Stigmergic construction and topochemical information shape ant nest architecture” https://www.pnas.org/doi/full/10.1073/pnas.1509829113, https://pmc.ncbi.nlm.nih.gov/articles/PMC4747701/#abstract2
  • ◼
  • Theraulaz, G., Bonabeau, E. (1999). “A brief history of stigmergy.” Artificial Life 5(2):97–116.
  • ◼
  • Dorigo, M., Stützle, T. (2004). Ant Colony Optimization. MIT Press. (Modern stigmergic algorithms applied to optimisation.)
  • ◼
  • Shannon, C. E. (1948). “A Mathematical Theory of Communication.” Bell System Technical Journal 27:379–423. (Shannon entropy, used in the Structural encoder’s sliding-window diversity signal.)
  • ◼
  • Documentation, install scripts, and screencasts: https://nit.tools.
  • ◼
  • Distribution: https://download.nit.tools (curl/PowerShell installers, Homebrew tap, GitHub Releases).
  • CITE THIS NOTEBOOK

    Neural interface terminal: a living system for AI-orchestrated work​
    by Brian A. Mboya​
    Wolfram Community, STAFF PICKS, May 22, 2026
    https://community.wolfram.com/groups/-/m/t/3720941