jonnifyagile agents
jonnify / Agile Agent Workflow / A4 · Spec / A4.5 · Invariants

A4.5 · The spec layer

Invariants that must always hold

An invariant holds for every value, always. An acceptance check holds for one scenario. Naming the two apart is how a spec states the rules a slice must never break, separately from the examples that prove it behaves.

An invariant is universally quantified — true for all values, at all times, named once and exercised by checks. An acceptance check is one named scenario — a single Given/When/Then that proves one example. The Portal's master invariant is the canonical example. Three dives: invariant vs check, the master invariant, and why “always” needs more than a finite set of passing checks.

An invariant, or a check

A spec carries two kinds of claim about a slice. An invariant is a rule that holds for every value the increment can take — it is named once, in the spec's Invariants section, and quantifies over all inputs. An acceptance check is one scenario — a single Given/When/Then on a story that proves one example behaves. The first says for all; the second says for this case.

Select a statement below to classify it. The master invariant and “the error set is closed” are invariants — universal rules. A single Given/When/Then is a check — one scenario. The readout names the kind and why.

Classify the statement · invariant or check

INVARIANT holds for every value always · for all named once in Invariants CHECK holds for one scenario for this case a Given/When/Then on a story the selected statement lights the kind it is
Invariant · holds for every value, always. “The web layer calls only the Portal facade …” is a universal rule — true for every request, every controller, every template. Named once; exercised by checks, never replaced by them.

An invariant is a universal rule; a check is one scenario — the spec names them apart, and a rung is done only when every invariant holds and every check passes.

The three dives

Each dive takes one move, in the arc tell apart → read the canonical one → hold it for all: distinguish an invariant from a check, read the Portal's master invariant as the canonical example, and see why “always” needs more than a finite set of passing checks. Read them in order — A4.5.1 starts.

After A4.5, the next module — A4.6 · Traceability — correct by definition — walks the chain from deliverable to story to check and invariant, and closes “done” by a rule. Return to the A4 chapter navigation to continue.

References

The sources behind the invariant-as-universal-rule and where it connects in the course.

Sources

Related in this course