# Orchestration invariants

> A collaboration relies on invariants, and what each invariant has to carry is described in stating an invariant: the property in a form that could be false, the…

Page: PAG · Orchestration
Canonical: https://banes-lab.com/pag/orchestration#orchestration-invariants

This section is stop 86 of 102 in the learning route. Previous: [05 - Handoff signals](https://banes-lab.com/pag/orchestration/handoff-signals.md). Next: [01 - Core templates](https://banes-lab.com/pag/templates/templates-core.md). It builds on [03 - Shared surfaces](https://banes-lab.com/pag/orchestration/shared-surfaces.md), [05 - Handoff signals](https://banes-lab.com/pag/orchestration/handoff-signals.md).

A collaboration relies on invariants, and what each invariant has to carry is described in [stating an invariant](https://banes-lab.com/disciplined-methodology/collaborate/stating-an-invariant.md): the property in a form that could be false, the set it ranges over, the parties it binds, and the objector that would disagree if it stopped holding. [F1·a invariant records](https://banes-lab.com/pag/orchestration#orchestration-invariants-panel-a) shows the records, [F1·b gate cites records](https://banes-lab.com/pag/orchestration#orchestration-invariants-panel-b) shows a gate pointing at them, and [F1·c three homes](https://banes-lab.com/pag/orchestration#orchestration-invariants-panel-c) shows where each record is read.

### Declared once, cited thrice

An invariant restated in every document that needs it becomes a set of copies that drift. A document's closing lines, a role and a check each carry their own wording of one rule, one of them is edited, and the other two keep binding the old rule. A restatement is a copy, and a copy carries no edge back to the statement it copied; a bullet is a restatement with even the statement's slots dropped.

For this reason an invariant has one statement, and every other mention of it is a pointer to that statement. Each invariant is declared once as a record with four slots and pointed at from every place that needs it, rather than restated wherever a party reads it. In practice, every invariant a collaboration relies on is declared as a record with four slots, and where nothing in any artifact would disagree, the objector is written as none, so the debt is declared rather than hidden. A gate check cites the record it holds, and a role names the invariants its party protects, as described in [a seat is a contract](https://banes-lab.com/disciplined-methodology/start/a-seat-is-a-contract.md). A block is never headed with a bare modifier and a list of bullets, because a bullet carries no set, no parties and no objector, which is why the scan refuses it.

To check this, name for each gate check and role entry the invariant record it points at. A line that points at nothing is a copy, and the record it should point at is the finding. A record whose objector is none is the debt described in [a tension has a mechanism](https://banes-lab.com/software-architecture/principles/a-tension-has-a-mechanism.md), for a rule with no check. The number of invariants grows with the number of parties and [shared surfaces](https://banes-lab.com/pag/orchestration/shared-surfaces.md).

One statement has three homes that point at it. A document's invariant block holds the records, a role lists by name the invariants its party protects, and a gate check holds the half that an artifact can observe; where the objector is none, that check is the only watcher, and it says so. An invariant has to reach every party that needs it, and pointing is how it reaches them without a copy that can disagree, so the record is the unit that is derived again whenever the invariant changes.

F1·a invariant records

```pag
# CROSS-NODE INVARIANTS  (each a record with four slots · a property nothing would object to declares its objector as none)
INVARIANT one-writer-per-record: a record is written only by the party named on it over: every record on every shared surface binds: every party that writes a surface objector: [check] the anchored edit refuses a write outside the caller's span
INVARIANT no-written-state: no party writes a status marker over: every item on the coordination surface binds: every party objector: [check] a scan for markers on every run
INVARIANT handler-removes: an item is removed by a party in its reader set over: every closed item binds: every party objector: none

# the scan reads the four slots and refuses a record missing one
[check] every invariant names its set, its parties and its objector (evidence: the defect scan) over: <invariants> measured: <complete> / <invariants>
```

F1·b gate cites records

```pag
# a node's gate cites the invariant it holds rather than restating it
HANDOFF GATE:
[check] the write landed inside the caller's span (evidence: the anchored edit's report)     # <one-writer-per-record>
[check] no marker written (evidence: the marker scan)                                          # <no-written-state>
[check] the removed item named this party in its reader set (evidence: the item's fence)     # <handler-removes> · objector none, so this check is the only watcher
result: pass → NODE 4 | span breached → REPAIR (owner: NODE 3) | unknown → BLOCKED
```

F1·c three homes

```mermaid
flowchart LR
stated["One record per invariant · property, set, parties, objector"]
closing["The document's invariant block · holds it"]
role["The role · the invariants this party protects, by name"]
check["A gate check · the half an artifact can observe"]
closing --> stated
role --> stated
check --> stated
```

## Links to

- [Stating an invariant](https://banes-lab.com/disciplined-methodology/collaborate/stating-an-invariant.md)
- [A seat is a contract](https://banes-lab.com/disciplined-methodology/start/a-seat-is-a-contract.md)
- [Shared surfaces](https://banes-lab.com/pag/orchestration/shared-surfaces.md)
- [A tension has a mechanism](https://banes-lab.com/software-architecture/principles/a-tension-has-a-mechanism.md)

## Linked from

- [Writing constraints](https://banes-lab.com/pag/guide/writing-constraints.md)
- [The board and the venue](https://banes-lab.com/disciplined-methodology/collaborate/the-board-and-the-venue.md)
- [Stating an invariant](https://banes-lab.com/disciplined-methodology/collaborate/stating-an-invariant.md)
