Contributor Guide
When to use this page
Use this page when you are working on the mechestim repository itself rather than only consuming the published API.
Repository layout
This repository contains three Python packages plus docs and Docker assets:
| Path | Purpose |
|---|---|
src/mechestim/ |
Core library backed by NumPy |
mechestim-client/src/mechestim/ |
Client proxy used in sandboxed participant environments |
mechestim-server/src/mechestim_server/ |
ZMQ server that executes the real library |
tests/ |
Core library test suite |
mechestim-client/tests/ |
Client unit, integration, and adversarial tests |
mechestim-server/tests/ |
Server unit tests |
docs/ |
MkDocs source |
scripts/generate_api_docs.py |
Generates the API/reference inventory pages |
docker/ |
Local client-server and hardened evaluation images |
Initial setup
For normal work on the core package, docs, and root test suite:
make install runs uv sync --all-extras and configures the local git hooks.
Which environment to use
The root environment covers the core package, linting, docs, and the main test
suite. The client and server each also have their own pyproject.toml.
One important caveat: mechestim-server depends on the local mechestim
package, which is not resolved from a package index in a fresh source checkout.
For server development, run commands from the repository root with
PYTHONPATH=src:mechestim-server/src instead of relying on cd mechestim-server
&& uv run ....
Common commands
Core library
If you prefer direct uv commands:
Client package
The client package is independently installable, so its test suite can run via its own project file:
Client integration and adversarial tests start a real server subprocess using
the repository root .venv/bin/python, so run make install first.
Server package
Run server tests from the repository root so the local core package is on
PYTHONPATH:
PYTHONPATH=src:mechestim-server/src \
uv run --with pyzmq --with msgpack pytest mechestim-server/tests
To launch the server manually from a source checkout:
PYTHONPATH=src:mechestim-server/src \
uv run --with pyzmq --with msgpack \
python -m mechestim_server --url ipc:///tmp/mechestim.sock
Running client and server together without Docker
From a source checkout, use repo-root commands so both packages resolve correctly:
# Terminal 1
PYTHONPATH=src:mechestim-server/src \
uv run --with pyzmq --with msgpack \
python -m mechestim_server --url ipc:///tmp/mechestim.sock
# Terminal 2
export MECHESTIM_SERVER_URL=ipc:///tmp/mechestim.sock
PYTHONPATH=mechestim-client/src \
uv run --with pyzmq --with msgpack python your_script.py
See Running with Docker if you want the same split using containers.
Generated documentation
Do not hand-edit pages that start with:
Today that includes:
docs/api/fft.mddocs/api/linalg.mddocs/api/polynomial.mddocs/api/random.mddocs/api/window.mddocs/reference/cheat-sheet.mddocs/reference/operation-audit.md
Instead, update scripts/generate_api_docs.py, the relevant source docstrings,
or the operation registry, then regenerate:
Related pages
- Running with Docker — containerized client-server setup
- Client-Server Model — architecture overview
- NumPy Compatibility Testing — separate compatibility suite