# Derived state

> Every reader derives the state of the work each time, by looking at what is on disk, the route through the tree shown in two routes].

Page: Methodology · Verify
Canonical: https://banes-lab.com/disciplined-methodology/verify#derived-state

This section is stop 45 of 102 in the learning route. Previous: [30 - One correct answer](https://banes-lab.com/disciplined-methodology/verify/one-correct-answer.md). Next: [32 - Counting copies](https://banes-lab.com/disciplined-methodology/verify/counting-copies.md). It builds on [28 - A report, not a checkbox](https://banes-lab.com/disciplined-methodology/verify/a-report-not-a-checkbox.md).

Every reader derives the state of the work each time, by looking at what is on disk, the route through the tree shown in [F1·a two routes](https://banes-lab.com/disciplined-methodology/verify#derived-state-panel-a). A checkbox that you or the model ticked is a claim, while a report a run wrote is evidence. A count you typed is a copy of a fact the tree already holds, and it is wrong from the first change you did not carry over to it. The property this aims at is [self-describing architecture](https://banes-lab.com/records/arch/self-describing-architecture.md), the health test named in [a system is a graph](https://banes-lab.com/software-architecture/model/a-system-is-a-graph.md), and here [introspection](https://banes-lab.com/records/arch/introspection.md) over the tree replaces every written status.

### Derived, never written

Markers written into a plan describe the past and get read as the present. The plan says three of five phases are done, two of the three were undone by a later change, and the plan still says three. Nothing re-reads a marker after the tree moves, so its staleness has no observer.

For this reason the state is derived from the tree and never written, and history is kept apart from the current truth. The cost of a traversal is paid on every read, rather than the cost of staleness on every write. In practice, counts, statuses and progress are derived by traversal and written nowhere, and history is kept out of the documents that state what is true now. A superseded statement is deleted rather than marked, and a document that states how many of something exist is regenerated rather than written by hand.

To check this, delete a written status and derive it again. If the derived value differs from the written one, the written one was already wrong. A prior value that a mechanism consumes to compute a change is an input, not history. A drift detector needs both states; the earlier one lives in the artifact the comparison produces and disappears when the comparison does. The test is whether removing the comparison would leave the value still written.

Written into the plan, a status reads *phase three of five, done, updated last week*; derived from the tree, it reads *phase three of five, two tasks open, one closed since the last run*. The first was true once, and the second is true now. The difference is not a matter of diligence. A written marker goes stale by construction, and a stale marker creates a false belief, while an absent marker simply reads as absence.

The same rule reaches documents: every document states what is true now. It carries no change notes, no clauses saying what something was renamed from, no dates tied to our own actions, and no explanation of the current state in terms of a former one. History has two homes and no third: an accumulator that a mechanism can read, and the message the developer receives. The check that enforces this is described in [documentation is code](https://banes-lab.com/disciplined-methodology/verify/documentation-is-code.md).

F1·a two routes

```mermaid
flowchart TB
tree["The tree on disk"]
traverse["A traversal, every time"]
state["The current state"]
written["A status written last week"]
reader["The reader"]
tree --> traverse --> state --> reader
written -. read as the present .-> reader
tree -. changed since .- written
```

## Links to

- [Self-Describing Architecture](https://banes-lab.com/records/arch/self-describing-architecture.md)
- [A system is a graph](https://banes-lab.com/software-architecture/model/a-system-is-a-graph.md)
- [Introspection](https://banes-lab.com/records/arch/introspection.md)
- [Documentation is code](https://banes-lab.com/disciplined-methodology/verify/documentation-is-code.md)

## Linked from

- [Orchestration as declared structure](https://banes-lab.com/pag/orchestration/declared-structure.md)
- [Shared surfaces](https://banes-lab.com/pag/orchestration/shared-surfaces.md)
- [Planning templates](https://banes-lab.com/pag/templates/templates-planning.md)
- [The stance](https://banes-lab.com/disciplined-methodology/start/the-stance.md)
- [The behaviour document](https://banes-lab.com/disciplined-methodology/start/the-behaviour-document.md)
- [The plan is a graph](https://banes-lab.com/disciplined-methodology/plan/the-flat-checklist.md)
- [Tools live in the tree](https://banes-lab.com/disciplined-methodology/build/tools-live-in-the-tree.md)
- [One home](https://banes-lab.com/disciplined-methodology/build/one-home.md)
- [Coordination is software](https://banes-lab.com/disciplined-methodology/collaborate/coordination-is-software.md)
- [A system is a graph](https://banes-lab.com/software-architecture/model/a-system-is-a-graph.md)
- [This page is derived](https://banes-lab.com/anatomy/reading/this-page-is-derived.md)

## Evidence in the code

- [linkTabs](https://banes-lab.com/source/tree/domain/converters/link.converter.ts.md)
- [chapterVocabulary](https://banes-lab.com/source/tree/domain/converters/chapter.converter.ts.md)
- [joinGlossary](https://banes-lab.com/source/tree/domain/converters/link.converter.ts.md)
- [matchPhrases](https://banes-lab.com/source/tree/core/matchers/vocabulary.matcher.ts.md)
- [linkText](https://banes-lab.com/source/tree/domain/converters/link.converter.ts.md)
