# From intent to predicate

> This section covers how an architectural intent becomes a predicate a check can run.

Page: Architecture · Coverage
Canonical: https://banes-lab.com/software-architecture/coverage#an-architecture-is-its-predicate-set

This section is stop 68 of 102 in the learning route. Previous: [04 - Debt and leverage](https://banes-lab.com/software-architecture/decay/debt-and-leverage.md). Next: [02 - What can drift, seen through how it drifts](https://banes-lab.com/software-architecture/coverage/what-can-drift-seen-through-how-it-drifts.md). It builds on [01 - A system is a graph](https://banes-lab.com/software-architecture/model/a-system-is-a-graph.md), [01 - Principles are typed](https://banes-lab.com/software-architecture/principles/principles-are-typed.md), [05 - Resolving a message](https://banes-lab.com/disciplined-methodology/start/resolving-a-message.md).

This section covers how an architectural intent becomes a predicate a check can run. The reasoning axis of the ontology turns a question into a type and a type into a predicate, as shown in [A1·a intent to predicate](https://banes-lab.com/software-architecture/coverage#an-architecture-is-its-predicate-set-panel-a), and the same axis is walked on a request in [resolving a message](https://banes-lab.com/disciplined-methodology/start/resolving-a-message.md) on the methodology page. How much of a design is real depends on who writes the code, as shown in [A1·b what is real](https://banes-lab.com/software-architecture/coverage#an-architecture-is-its-predicate-set-panel-b).

### Question, type, predicate

Architecture is usually a set of intentions, and an intention cannot be evaluated, so neither the developer nor the model can say how much of the architecture is real. A design document states twelve principles, the codebase honours four, and no reviewer can say which four without reading everything, because the other eight were never anything a check could evaluate. An intention has no objector, so its first violation is silent, and a system whose rules are silent is governed by attention rather than by structure.

For this reason an architecture is its predicate set, and a predicate selects what to examine and marks when the concern is closed. The architecture is counted by what the gate refuses rather than by what the document states. In practice, every architectural intent is stated as a question about [what can drift, seen through how it drifts](https://banes-lab.com/software-architecture/coverage/what-can-drift-seen-through-how-it-drifts.md), and the question is resolved to a type. What exists is a set, how parts are arranged is an ordering, what connects is a graph, and how sure you are is a number. The predicate is derived from the type and run over the tree as a check.

To check this, list the architectural claims your system makes. Beside each, name the predicate that decides it and where that predicate runs. A claim with no predicate beside it is a sentence in a document, and the document is the only place it holds. [Determinism](https://banes-lab.com/records/arch/determinism.md) lives in the predicate and never in the judgement that authored it. Which cells are worth watching is a decision, while whether a cell's predicate holds is a computation. The decision stays with the developer and the computation with the check, and a predicate never encodes taste.

### A predicate does two jobs

The double duty is what makes derivation possible. The predicate that says an export is unreachable is the same predicate that says reachability is covered, so one reading tells you where to work and the other tells you the dimension is watched. A project that has the first without the second accumulates checks by incident, and one that has both can derive its checks from its invariants.

[Policy as code](https://banes-lab.com/records/arch/policy-as-code.md) is the canon's name for the whole move, and [fitness functions](https://banes-lab.com/records/arch/fitness-functions.md) are the same predicates run against an architecture rather than a request. [Static analysis](https://banes-lab.com/records/arch/static-analysis.md) is where most predicates live, because a shape in a tree can be decided without running anything, and [design by contract](https://banes-lab.com/records/arch/design-by-contract.md) is the same idea one level down, with preconditions, postconditions and invariants that a check can evaluate rather than a comment can promise.

### Coverage from the grid, never from a count

The coverage question is then answered from the grid described in what can drift, seen through how it drifts, rather than from a count of rules. [Security theater](https://banes-lab.com/records/arch/security-theater.md) is what a count produces, with the presence of controls standing in for their coverage. A predicate set answers the other question, which cells have something that can disagree with them, and that is the only sense in which an architecture is enforced.

A1·a intent to predicate

```mermaid
flowchart TB
intent["An architectural intent · a sentence about how the system should be"]
question["A question · what can drift, seen through how it drifts"]
type["A mathematical type · a set, an ordering, a graph, a number"]
predicate["A predicate · computable over the tree"]
selects["Selects what to examine next"]
closes["Marks when the concern is closed"]
habit["A habit · held while the developer remembers"]
intent --> question --> type --> predicate
predicate --> selects
predicate --> closes
intent -. without the walk .-> habit
```

A1·b what is real

```mermaid
flowchart TB
design["A design"]
intentions["Its intentions · what the author meant"]
predicates["Its predicate set · what a check can decide"]
author{"Who writes the code?"}
person["The developer · intentions survive by attention, for a while"]
model["A model · every intention with no predicate is absent"]
real["The architecture that is real · the predicate set"]
design --> intentions
design --> predicates
intentions --> author
author -- developer --> person
author -- model --> model
predicates --> real
model -. only this survives .-> real
```

## Links to

- [Resolving a message](https://banes-lab.com/disciplined-methodology/start/resolving-a-message.md)
- [What can drift, seen through how it drifts](https://banes-lab.com/software-architecture/coverage/what-can-drift-seen-through-how-it-drifts.md)
- [Determinism](https://banes-lab.com/records/arch/determinism.md)
- [Policy as Code](https://banes-lab.com/records/arch/policy-as-code.md)
- [Fitness Functions](https://banes-lab.com/records/arch/fitness-functions.md)
- [Static Analysis](https://banes-lab.com/records/arch/static-analysis.md)
- [Design by Contract](https://banes-lab.com/records/arch/design-by-contract.md)
- [Security Theater](https://banes-lab.com/records/arch/security-theater.md)

## Linked from

- [Resolving a message](https://banes-lab.com/disciplined-methodology/start/resolving-a-message.md)
