A procedure that writes the specification is idempotent
Every procedure that writes the specification, or what is generated from it, is idempotent: run again on what its previous run left, it gives the same result and changes nothing, so running it again is always safe. A procedure needed only once, such as bringing existing documents into the model, is removed once it is done, since it is idempotent only on the state of the specification it was written for.
Whoever works on the specification may run such a procedure at any time, by hand or as part of a check, without knowing whether it has run before; one whose second run changed anything would damage the specification the next time it ran. A procedure written for one state of the specification can damage a later one.
The links made to it
The decisions taken on it
- Problem
Safety to run again was stated of the commands of one toolset, in words that did not name the property they meant.
- Ruling
The owner: it is stated of every procedure that writes the specification, by its standard name, idempotent.
The tests bound to it
- skills/tools/test/e2e/init.test.ts · s-jsqxdx47wkkj7gp run again, sheriff init changes nothing
- skills/tools/test/unit/generated.test.ts · s-jsqxdx47wkkj7gp exporting again changes nothing, and leaves no export of a file that is gone
- skills/tools/test/unit/reindex.test.ts · s-jsqxdx47wkkj7gp run again on what it left, the reindex changes nothing
- skills/tools/test/unit/spec-files.test.ts · s-jsqxdx47wkkj7gp keeps the order of keys, non-ASCII text as it is, and LF line endings
- skills/tools/test/unit/spec-files.test.ts · s-jsqxdx47wkkj7gp writes a file in the canonical formatting, so that writing what was read changes nothing