{"id":"2091515787366306154","url":"https://x.com/hanakoxbt/status/2091515787366306154","text":"","author":{"name":"Hanako","username":"hanakoxbt","avatarUrl":"https://pbs.twimg.com/profile_images/1942867829016911872/zDosF-7X_200x200.jpg"},"createdAt":"Sun Aug 23 13:19:56 +0000 2026","engagement":{"replies":9,"retweets":42,"likes":308,"views":572548},"article":{"title":"Loops and Graphs: how to stop babysitting agents and only approve the last step (full course) ","previewText":"You check every step your agents take. Not because you want to, but because nothing else does.\nGetting out of that chair takes two things, and almost everyone builds only one of them.\nA loop makes a","coverImageUrl":"https://pbs.twimg.com/media/HQaNiAyXMAEIPNz.jpg","content":"You check every step your agents take. Not because you want to, but because nothing else does.\n\nGetting out of that chair takes two things, and almost everyone builds only one of them.\n\nA loop makes a unit of work correct without you. A graph decides which units exist at all.\n\nHere is the split, the mechanics that are not obvious, and the point where you approve one thing instead of everything.\n\n## A loop is a check that can fail\n\nStrip everything else away and a loop is four parts: produce, check, correct, repeat until green.\n\nThe check is the whole thing.\n\nWithout something that can fail the work while you are out of the room, you do not have a loop. You have a scheduler.\n\nThis sounds obvious and almost nobody writes the check first.\n\nThey build the work, then bolt a review onto the end, and the review is another model asked to look at the output.\n\nTwo optimists agreeing.\n\nWrite the condition first, and write it so a program could evaluate it:\n\nThat last one catches careful people. Absence of an error is not evidence of correctness.\n\nBuild a loop on it and you get a system that confidently repeats a mistake until the budget runs out, with a clean log the whole way.\n\n## The ceiling nobody warns you about\n\nA loop makes one unit of work better. That is its entire job, and it is very good at it.\n\nIt cannot decide which units exist, or their order, or notice that two of the five steps never needed to wait for each other.\n\nSo you get a very good agent running the wrong three steps, in the wrong order, one at a time.\n\nEvery step is correct. The result is still slow and still wrong-shaped, and tuning the loop will not fix it, because the fault is not inside any unit.\n\nThat is the moment people blame the model. It is also the moment the next layer starts paying for itself.\n\n![](https://pbs.twimg.com/media/HQZ4wCCWgAA5YYj.png)\n\n## The graph is the layer above\n\nA graph is the shape of the work: what runs, what runs at the same time, what waits, what never runs at all, and where results go back.\n\nTwo things and nothing else. A node is a unit of work: one bounded job, one input in, one output out.\n\nAn edge is a dependency, this node's output feeds that node's input.\n\nThe mistake behind every unnecessary wait is treating \"and then\" as an edge.\n\nSummarize the file and then check the weather has no edge between them. The weather does not consume the summary.\n\nThose are two independent nodes that a linear script chained, and the chaining came from the order you typed them.\n\nSo run this on every arrow in a pipeline you already have: does the next step actually read the previous step's output?\n\nIf you cannot name the variable that crosses, there is no edge, and the wait is pure waste.\n\nMost chains have two or three arrows like that, and finding them is usually the largest single speedup available.\n\n> The full breakdown of all five layers, in the order they matter, is here: agent-layers.vercel.app\n\n## Four kinds of node, and one of them is not a model\n\nSplitter, worker, code node, gate. That is the whole vocabulary.\n\nThe splitter cuts the work into units and sits at the front.\n\nIt decides more than any other node, because splitting by the wrong dimension wastes everything downstream.\n\nCut a repository by folder and four workers audit the same three files.\n\nCut by blast radius and each one sees something the others cannot.\n\nWorkers do one unit each, with one lens, in their own context. That last part gets skipped constantly.\n\nGive four auditors a shared window and they converge: the first writes a finding, the rest read it, and all four reports centre on the same thing.\n\nYou paid four times for one opinion with three echoes.\n\nThe code node is the one people forget exists. Merging, ranking, deduplicating, comparing every export before and after.\n\nNone of that is reasoning. Each has exactly one correct answer, each is a few lines of code, and running it through a model adds cost, latency and variance to a step that had none.\n\nIf you can describe the transformation without using the words judge, decide, assess or summarize, it is code.\n\nA graph where every edge is an agent pays rent on its own wiring.\n\n![](https://pbs.twimg.com/media/HQZ5BxZXwAAY8_J.png)\n\n## Where the loop actually lives\n\nOne sentence resolves the whole confusion. The loop lives inside a node. The graph lives between them.\n\nInside one unit: produce, check, correct, repeat until green.\n\nBetween units: split, fan out, merge, gate, send back. None of the second list is expressible from inside a single unit.\n\nSo you do not choose. A graph without loops in its nodes produces unverified work in parallel, which is worse than serially because there is more of it.\n\nA loop without a graph around it is one very good step in a queue nobody designed.\n\n## The two return paths, and the one everyone skips\n\nA graph without a way back is a pipeline. It produces output and forgets.\n\nNext week it starts from the same place with the same blind spots.\n\nWorking graphs have two return paths, doing different jobs.\n\nThe correction edge is short. A gate rejects one unit back to the step that produced it, and it fixes the run you are in.\n\nThe learning edge is long. An accepted result goes back to the splitter as a constraint, and it fixes every run after.\n\nAlmost everyone builds the first and skips the second. The tell is a system that is fast and never gets smarter.\n\nThe learning edge does not carry the output, it carries a constraint derived from it:\n\nNotice where it lands. Not in the worker's instructions, in the brief that shapes how the work gets cut.\n\nA confirmed cause becomes a rule, so the next break starts where this one ended.\n\n![](https://pbs.twimg.com/media/HQZ6Gt9WQAAbTUk.png)\n\n## Return the unit, not the batch\n\nThis is the most expensive mistake on the return path, and it is worth stating plainly.\n\nFour slices were ported. One fails its tests. If the whole batch goes back, three correct slices get rewritten.\n\nTheir next version is different, not better, because nothing was wrong with them.\n\nNow you re-verify all four, and any of the three may fail this time for unrelated reasons.\n\nYou converted one failure into four uncertain outcomes and paid for the privilege. Do it twice in a run and it never converges.\n\nFrom the outside this looks like the model failing repeatedly. It is a return path destroying correct work.\n\nFour things travel with a return, and each is doing a job:\n\nThe scope line matters more than it looks.\n\nWithout it a returned unit grows: the agent opens the file, notices two adjacent issues, fixes those too, and your one-slice correction becomes a four-file diff nobody reviewed.\n\nCap it at three attempts. If a unit fails three corrections the problem is in the plan that produced it, and the loop cannot see the plan.\n\n## Open the gate on blast radius, not on confidence\n\nMost write-ups build a confidence score, set a threshold, and let anything above it through. That is the wrong variable.\n\nConfidence is the weakest input in that decision, for a reason that is easy to miss: it is the only one the model can influence.\n\nThe strong variable is what happens if the change is wrong. Sort work by how expensive the mistake is to undo:\n\nReversible and contained. A copy change, a test, an isolated function with coverage. One bad merge costs a revert, so this lane can open first.\n\nReversible but wide. A shared utility, a schema addition, anything a dozen callers touch. Gate on deterministic checks plus a clean trajectory.\n\nHard to reverse. Migrations, deletions, anything writing to production data or moving money. This lane does not open, regardless of score.\n\nThat third row is not a threshold set very high. It is a lane that does not open, and the distinction matters because thresholds get adjusted and closed lanes do not.\n\nInside an open lane the gate reads evidence in order: deterministic results, then the trajectory of this run, then how often work from this node has been rolled back before, and the model's own assessment last.\n\n![](https://pbs.twimg.com/media/HQZ5mTxXUAANsQt.jpg)\n\n## Where to start on your own work\n\nTake one thing you do repeatedly. Draw the splitter, the lanes, the merge, one gate, one back edge.\n\nBuild the gate first. Everything gets easier once something can fail loudly, and a graph without a gate is just a faster way to produce unverified output.\n\nThen the lanes. Then the learning edge, last, because you cannot derive constraints from accepted results until something is accepting results.\n\nPut the human on one step, at the point of highest consequence and lowest reversibility.\n\nApprove the merge. Choose which fixes ship. Not reviewing intermediate output, not confirming each step.\n\nA human in the middle of a graph becomes the slowest node in it, and the graph runs exactly as fast as a person reading things.\n\n> I put all five layers into a full course, twenty lessons with the templates, the configs and the order to build them in: agent-layers.vercel.app\n\nThree lines hold the whole discipline. Measure the path, not only the answer it landed on.\n\nA verdict that does not change what runs next is a report.\n\nAnd any failure you do not turn into a permanent constraint, you will meet again.\n\nMost people will keep tuning one loop and calling it a system.\n\nThe ones who draw the graph around it will run a fleet, and never quite understand why everyone else finds it so hard to keep up.\n\nIf you want the one-page version of the graph layer before anything else, DM me the word Graph.\n\nAlso follow me for more on agent internals, and subscribe to my Telegram channel:\n\n[https://t.me/+75nMf005jRpjMDU1](https://t.me/+75nMf005jRpjMDU1)"},"adhxContext":{"savedByCount":1,"publicTags":[],"previewUrl":"https://adhx.com/hanakoxbt/status/2091515787366306154"}}