Pre-alpha documentation
Validate StateKnot locally.
A contributor tutorial for installing the pinned toolchain and reproducing the repository's executable quality gates.
Prerequisites
- Git.
- rustup; the repository pins Rust 1.88.0 with the minimal profile, rustfmt, and Clippy.
- PostgreSQL is optional for the fast workspace gate and required for the provider integration suite.
Run the typed contract examples
The next tutorial constructs the real schema-pinned Agent contract and both provider adapters without external I/O or credentials. Continue to Build a typed Agent contract after the workspace gate passes.
Clone and run the complete local gate
Run these commands from a clean checkout. rustup reads
rust-toolchain.toml automatically.
git clone https://github.com/StateKnot/StateKnot.git
cd StateKnot
cargo fmt --all --check
cargo clippy --workspace --all-targets --all-features --locked -- -D warnings
cargo test --workspace --all-targets --all-features --locked
RUSTDOCFLAGS="-D warnings" cargo doc --workspace --all-features --no-deps --locked Read the result correctly
A green local gate proves that:
- the pinned compiler accepts every workspace target and feature;
- the core contract, canonical wire, property, and unit tests pass; and
- public Rust documentation contains no warnings.
It does not exercise a live PostgreSQL server, a live model-provider account, MCP, A2A, or a live durable Agent Loop. CI runs the database-backed Runtime and storage-provider suites separately against PostgreSQL 16 and 17; model-adapter transport tests use a real local TCP server.
Run the PostgreSQL integration suite
Point the suite at a disposable database. The test role must be able to create and drop a temporary database because startup and migration failures are part of the contract.
STATEKNOT_TEST_DATABASE_URL=postgres://USER:PASSWORD@HOST:PORT/DATABASE \
STATEKNOT_REQUIRE_POSTGRES_TESTS=1 \
cargo test -p stateknot-store-postgres --test postgres --locked -- --test-threads=1 Never point this command at a production or shared database. Continue with the PostgreSQL provider guide for the production-shaped connection and migration boundary.