# How to add a law

From a blank idea to a law that is in, by the constitution.

1. **Write it in Python first**, in the engine it belongs to (or a new module under `sitoolz/`), with a docstring that says the arithmetic in a sentence and names its author. Add it to the module's `__all__` and to its `verify()` with one check that would fail if the law were wrong.
2. **Port it to JavaScript** in `js/<engine>.js` under the camel-case name, the same argument order, the same defaults, the same rounding. Watch the three usual traps: integers past `2^53` (use BigInt, and send them through JSON as strings), Python's negative `%` (use `((a % n) + n) % n`), and floating dust from summed cosines (compare with a tolerance and say why on the card).
3. **Put it in the fixture**: `tests/write_<engine>_fixture.py` writes the numbers from the Python; `tests/twins-<engine>.test.cjs` reads them and asks the JavaScript. Sample the law where it is interesting (its edges, its far generations, its knobs), not only at zero.
4. **Write or extend the card** in `cards/<engine>.md`: the arithmetic, both signatures, what it produces, the fixture, the provenance line.
5. **Draw it** in `../sitoolz-showcase` if it makes a picture: a map in `maps.py` and the same map in `maps.js`; `node snap.cjs` must report it identical.
6. **Run everything**: `python3 tests/test_sitoolz.py && npm test`, then `python3 tools/catalog.py` so the catalog lists it, and tick the roadmap.

A law that exists only on one side, or only in prose, is not in yet.
