Version: 0.9.x
- Python: type hints everywhere, ruff for formatting/linting, Python 3.11+
- TypeScript: strict mode, ESM, Node 18+
- Docstrings on public APIs and modules
- Route handlers must be thin — delegate to services
- Business logic in
server/services/ - Data access in
server/db/repositories.py— all SQL lives here - Domain types in
server/domain/models.py - API schemas in
server/schemas/(requests.py, responses.py) - Error definitions in
server/core/errors.py - Middleware in
server/core/(middleware.py, auth.py, ratelimit.py, tenant.py) - Compilers implement
server/services/compilers.BaseCompilerprotocol - Embedding providers implement
server/services/embeddings.BaseEmbeddingProviderprotocol
- All errors return structured
{"error": {"code", "message", "details", "request_id"}}shape - Custom exceptions (
NotFoundError,ConflictError,ValidationError) inserver/core/errors.py - Middleware errors (auth, rate limit, tenant) use the same JSON shape
- SDKs parse these into typed exception classes
- pytest for Python repos (server + SDK),
asyncio_mode = "auto" - vitest for TypeScript SDK
- Server: ~680 tests (unit + integration; integration requires Postgres)
- Python SDK: 34 tests
- TypeScript SDK: 23 tests
- Integration tests use a separate test database via
conftest.pywithNullPool - New features should include unit tests; integration tests for data-path changes
All repos have GitHub Actions CI workflows:
- Server: lint + unit tests + integration tests on push/PR
- Python SDK (
statewave): lint + tests on push/PR - TypeScript SDK (
@statewavedev/sdk): build + tests on push/PR
Each package is versioned independently, per semver, per repo. There is no single workspace version that every package must match:
- The Python SDK (
statewave, PyPI), the TypeScript SDK (@statewavedev/sdk, npm), and the server release on their own cadences. A TS-only change bumps only the TS SDK; it does not force a Python or server release. - The cross-repo compatibility axis is the
/v1API contract — any SDK that speaks/v1works against any server that serves/v1. That guarantee lives in the API contract, not in matching version numbers. SDK ↔ server compatibility never depends on equal version strings. statewave/pyproject.tomlis the server / reference-implementation version. It backs only the server repo's own status surfaces and the conceptual-doc banners ("the system as implemented at server vX.Y").- Tooling:
tools/check-versions.py(run as a release gate instatewave.github/workflows/release.yml) verifies that server/contract self-reference only. It never asserts SDK-package-number equality — independent SDK versions are reported, never failed.tools/bump-version.pypropagates a server bump to server surfaces; SDK packages are bumped in their own repos.
SDK feature surface (current version is whatever each registry last published):
| SDK | Key features |
|---|---|
statewave (Python) |
Sync + async clients, typed exceptions, auth, tenant, semantic search, batch ingestion, subject listing, receipts + label / policy methods |
@statewavedev/sdk (TypeScript) |
Typed errors, auth, tenant, semantic search, batch ingestion, subject listing, ESM, receipts + label / policy methods |
All server settings via STATEWAVE_ prefixed env vars or .env file. See API contract for the full configuration reference.
- Conventional commits preferred
- One logical change per commit
- PRs should reference the target repo clearly
- Version tags: each repo tags its own independent
vX.Y.Zwhen it releases; there is no synchronized workspace-wide tag (see Versioning above)