# The loop

> Every piece of work in this method follows the same loop of ten steps, which I call nodes, whether the work is a one-line fix or a plan that runs for weeks.

Page: Methodology · Start
Canonical: https://banes-lab.com/disciplined-methodology#the-loop

This section is stop 1 of 102 in the learning route. Next: [02 - Who does what](https://banes-lab.com/disciplined-methodology/start/who-does-what.md).

Every piece of work in this method follows the same loop of ten steps, which I call nodes, whether the work is a one-line fix or a plan that runs for weeks. A plan, a check, an agent, a refactor and a review are all this one loop, run at a different size. I treat it as the first thing to learn, because each later chapter applies it to one kind of work, and every mechanism in the method exists to hold one of its gates: the points where the work may not continue until a condition holds. The nodes are shown in [A1·a ten nodes](https://banes-lab.com/disciplined-methodology#the-loop-panel-a) and the sizes in [A1·b four sizes](https://banes-lab.com/disciplined-methodology#the-loop-panel-b), and each node is published as a record on the ontology page: [orient](https://banes-lab.com/records/stage/orient.md), [intent](https://banes-lab.com/records/stage/intent.md), [see](https://banes-lab.com/records/stage/see.md), [derive](https://banes-lab.com/records/stage/derive.md), [project](https://banes-lab.com/records/stage/project.md), [act](https://banes-lab.com/records/stage/act.md), [constrain](https://banes-lab.com/records/stage/constrain.md), [verify](https://banes-lab.com/records/stage/verify.md), [commit](https://banes-lab.com/records/stage/commit.md), [terminate](https://banes-lab.com/records/stage/terminate.md).

### Ten nodes, every size

Work with a model tends to begin at the doing and skip everything that should come before it. The model starts writing code in its first reply and guesses what the goal is, and after that each reply answers the previous one rather than the task, so the conversation drifts away from what was asked. Nothing gave the work a shape, so the shape came from whatever sentence the model found most likely next.

For this reason I give every piece of work the same shape, the loop, whatever its size. A one-line fix goes through the same ten nodes as a plan does, rather than through a lighter process kept for small tasks. In practice this means running the loop at the size of the task and always knowing which node the work is on. Four of the nodes are gates that apply at every size: the work has to be worth doing before any effort goes into it, a change has to be allowed before it is trusted, a claim needs evidence before it is recorded, and the loop only ends as done when nothing is left, everything is done and everything is checked. If that last condition is not met, it ends as blocked instead.

To check this on your own work, take the plan, the check and the agent for a single task and read each of them as the same ten nodes. A step that fits none of them is either missing from the loop or does not belong in the work. The loop has its limits as well. It is not worth the ceremony for a throwaway script, and it pays off where you or your model will read, change or rely on the work later. A reference, a note or a contract is something you read rather than run, so forcing the full loop onto it adds ceremony without making it more reliable.

The ten nodes fall into three groups. The first, the [epistemic](https://banes-lab.com/records/reason/layer-epistemic.md) layer, is about knowing: orient decides what the subject is by reading it from the tree, see chooses how to look at it, derive draws a claim from what was seen, project picks the next step that is allowed, and act carries it out. The second, the [conative](https://banes-lab.com/records/reason/layer-conative.md) layer, is about what is worth doing: intent states the [objective](https://banes-lab.com/records/reason/node-tel-objective.md) and ranks the possible approaches by [priority](https://banes-lab.com/records/reason/node-tel-priority.md), and constrain checks that a change is allowed once it has been made. The third, the [evaluative](https://banes-lab.com/records/reason/layer-evaluative.md) layer, is about whether the result is right and whether the work is finished: verify asks for [evidence](https://banes-lab.com/records/reason/node-ver-evidence.md), commit writes the result down where the next round can read it, and terminate decides whether to [stop](https://banes-lab.com/records/reason/node-ter-stop.md).

The order between the nodes matters as much as the nodes themselves. A claim that turns out to be [refuted](https://banes-lab.com/records/reason/node-ver-refutation.md) goes back to derive together with the evidence that refuted it; it never carries on with a note attached. A repair restarts at the earliest node that can supply the missing evidence, and everything after that node is redone. The number of repairs is limited, so a loop that keeps repairing ends as [blocked](https://banes-lab.com/records/reason/node-ter-block.md) rather than as done. Each node also owes a specific kind of answer: a node that has to rank options is not satisfied by a yes, and a node that has to answer yes or no is not satisfied by a ranking. The same loop is what an [agent template](https://banes-lab.com/pag/templates/templates-agents.md) follows and what an [instruction pattern](https://banes-lab.com/pag/patterns/instruction-patterns.md) is chosen by, which is why the grammar page and this page describe one loop twice.

### Instruction and traversal

The loop also nests inside itself. A plan is one pass through the loop whose act node produces phases, each phase is a pass whose act node produces tasks, and each task is a pass that ends in an edit and a run of the checks. The gates apply at every level: a phase cannot start until the phase before it has recorded evidence the next one can read, and a plan cannot finish until every phase has done so. For this reason a plan has a gate between its phases rather than a tick beside each item, as described in [the plan is a graph](https://banes-lab.com/disciplined-methodology/plan/the-flat-checklist.md).

The difference between an instruction and a traversal, meaning one pass through the loop, shows within the first minute. An instruction asks for an outcome. A traversal names the nodes it passes through, so a reader can see where it went wrong. For example, asked to raise a file-size limit, a traversal starts by opening every file that mentions the limit, and finds that the limit is declared in three places. Its intent is one limit with a [single source of truth](https://banes-lab.com/records/arch/single-source-of-truth.md), so it concludes that the problem is the limit having more than [one home](https://banes-lab.com/disciplined-methodology/build/one-home.md), not its value. It changes the declaration, deletes the two copies and keeps to the one option the checker offers. It then runs the gate once and reads the output in full, records the report, and stops because the objective reads as true against the tree. The edit touched one file instead of three, and a reader of the messages can tell which node the work was on.

A1·a ten nodes

```mermaid
flowchart TB
subgraph epistemic["Epistemic · how is it known?"]
orient["Orient · name the subject, read from the tree"]
see["See · look through the lenses the subject warrants"]
derive["Derive · a claim grounded in what was seen"]
project["Project · the next admissible move"]
act["Act · apply the operation to the state"]
end
subgraph conative["Conative · what is worth doing?"]
intent["Intent · the objective, and the highest-worth branch"]
constrain["Constrain · is the operation admissible?"]
end
subgraph evaluative["Evaluative · is it right, and are we done?"]
verify["Verify · is the evidence set non-empty?"]
commit["Commit · externalise the result as inspectable state"]
terminate["Terminate · saturated, complete and verified?"]
end
orient --> intent
intent -- gate: worth before work --> see
see --> derive --> project --> act --> constrain
constrain -- gate: admissible --> verify
verify -- gate: evidence --> commit --> terminate
verify -. refuted, back with the evidence .-> derive
terminate -- gate: stop --> orient
```

A1·b four sizes

```mermaid
flowchart TB
fix["A one-line fix · one traversal, minutes"]
task["A task · one traversal, an afternoon"]
phase["A phase · one traversal that holds many tasks"]
plan["A plan · one traversal that holds many phases"]
fix --- task --- phase --- plan
plan -. each phase walks the loop again inside .-> phase
phase -. each task walks the loop again inside .-> task
```

## Links to

- [Orient](https://banes-lab.com/records/stage/orient.md)
- [Intent](https://banes-lab.com/records/stage/intent.md)
- [See](https://banes-lab.com/records/stage/see.md)
- [Derive](https://banes-lab.com/records/stage/derive.md)
- [Project](https://banes-lab.com/records/stage/project.md)
- [Act](https://banes-lab.com/records/stage/act.md)
- [Constrain](https://banes-lab.com/records/stage/constrain.md)
- [Verify](https://banes-lab.com/records/stage/verify.md)
- [Commit](https://banes-lab.com/records/stage/commit.md)
- [Terminate](https://banes-lab.com/records/stage/terminate.md)
- [Epistemic](https://banes-lab.com/records/reason/layer-epistemic.md)
- [Conative](https://banes-lab.com/records/reason/layer-conative.md)
- [Tel Objective](https://banes-lab.com/records/reason/node-tel-objective.md)
- [Tel Priority](https://banes-lab.com/records/reason/node-tel-priority.md)
- [Evaluative](https://banes-lab.com/records/reason/layer-evaluative.md)
- [Ver Evidence](https://banes-lab.com/records/reason/node-ver-evidence.md)
- [Ter Stop](https://banes-lab.com/records/reason/node-ter-stop.md)
- [Ver Refutation](https://banes-lab.com/records/reason/node-ver-refutation.md)
- [Ter Block](https://banes-lab.com/records/reason/node-ter-block.md)
- [Agent templates](https://banes-lab.com/pag/templates/templates-agents.md)
- [Instruction patterns](https://banes-lab.com/pag/patterns/instruction-patterns.md)
- [The plan is a graph](https://banes-lab.com/disciplined-methodology/plan/the-flat-checklist.md)
- [Single Source of Truth](https://banes-lab.com/records/arch/single-source-of-truth.md)
- [One home](https://banes-lab.com/disciplined-methodology/build/one-home.md)

## Linked from

- [What PAG is](https://banes-lab.com/pag/introduction/what-is-pag.md)
- [Why it works](https://banes-lab.com/pag/introduction/why-pag-works.md)
- [PAG and the method](https://banes-lab.com/pag/introduction/pag-and-the-method.md)
- [Document structure](https://banes-lab.com/pag/guide/document-structure.md)
- [Semantic operations](https://banes-lab.com/pag/guide/tool-invocation.md)
- [Node design](https://banes-lab.com/pag/guide/node-design.md)
- [Writing constraints](https://banes-lab.com/pag/guide/writing-constraints.md)
- [Orchestration as declared structure](https://banes-lab.com/pag/orchestration/declared-structure.md)
- [From intent to structure](https://banes-lab.com/pag/patterns/intent-to-structure.md)
- [Genesis stages](https://banes-lab.com/pag/patterns/genesis-stages.md)
- [Keywords](https://banes-lab.com/pag/keywords/keyword-ontology.md)
- [Validation gates](https://banes-lab.com/pag/validation/validation-gates.md)
- [Planning templates](https://banes-lab.com/pag/templates/templates-planning.md)
- [The stance](https://banes-lab.com/disciplined-methodology/start/the-stance.md)
- [Resolving a message](https://banes-lab.com/disciplined-methodology/start/resolving-a-message.md)
- [Worth before work](https://banes-lab.com/disciplined-methodology/plan/worth-before-work.md)
- [Execute the template](https://banes-lab.com/disciplined-methodology/plan/execute-the-template.md)
- [It looked right](https://banes-lab.com/disciplined-methodology/verify/it-looked-right.md)
- [One correct answer](https://banes-lab.com/disciplined-methodology/verify/one-correct-answer.md)
- [Agents as executed contracts](https://banes-lab.com/disciplined-methodology/collaborate/agents-as-executed-contracts.md)
- [A turn never ends to wait](https://banes-lab.com/disciplined-methodology/collaborate/a-turn-never-ends-to-wait.md)
- [The author is probabilistic](https://banes-lab.com/software-architecture/scale/the-author-is-probabilistic.md)
- [Systems built around a model](https://banes-lab.com/software-architecture/scale/systems-built-around-a-model.md)
- [The principle architecture](https://banes-lab.com/software-architecture/glossary/the-principle-architecture.md)
- [The derivation loop](https://banes-lab.com/ontology/reasoning/reason-loop-derivation-loop.md)
