Browse documentation
Development
On this page

Development setup

Wisp targets Python 3.11 or newer and uses uv for its locked development environment. Clone the repository, then install the package and development dependencies:

git clone https://github.com/whanyu1212/Wisp.git
cd Wisp
uv sync --locked

Run the four quality and test gates before considering a change complete:

uv sync                        # install (use `uv sync --locked` to match CI)
uv run ruff format --check .   # format
uv run ruff check .            # lint
uv run mypy                    # types — no path argument
uv run pytest tests            # full suite

The project uses strict mypy checking and Ruff with a 100-character line length and the E, F, I, UP, and B rule sets. Prefer async-first APIs with anyio, frozen dataclasses for internal value objects, and Pydantic models for serialized boundaries.

Rust TUI

The Rust frontend is a Cargo workspace member and is the sole interactive terminal interface. Native wheels on macOS arm64 and Linux glibc 2.28+ x86_64 bundle it. Pure/source installs retain the Python backend but require a matching source-built binary for interactive use. See the frontend boundary. The repository pins Rust 1.88.0 in rust-toolchain.toml, and every workspace crate declares rust-version = "1.88" through the workspace package settings.

Build and launch it with an absolute binary override:

cargo build -p wisp-tui
WISP_RUST_TUI_BINARY="$(pwd)/target/debug/wisp-tui" \
  uv run wisp tui

The tag-gated release flow assembles verified platform-wheel candidates. Installed native wheels place wisp-tui in the active Python environment’s scripts directory; the launcher never searches PATH. Source development uses the explicit override above. A relative WISP_RUST_TUI_BINARY=target/debug/wisp-tui is rejected rather than searched or resolved against the working directory.

The Rust frontend is exact-lockstep with the Python runtime. The current package and crate version is 0.16.13; for a prerelease only the spelling differs, such as 0.2.0rc13 (Python) and 0.2.0-rc.13 (Cargo). Rust translates -alpha.N, -beta.N, and -rc.N to Python’s aN, bN, and rcN before the exact version comparison. Neither the handshake nor events carry a protocol or schema version. Python’s models and committed schemas remain authoritative, and wisp-protocol generates its private Rust projections from those schemas at compile time. Package, protocol, or generated-schema drift must fail a check or the startup handshake rather than degrade to another contract.

Native wheels are built with pinned Hatchling and packaging/hatch_build.py; the source distribution and pure wheel stay on uv_build. How Wisp is built explains the two backends, what each release file contains, and how to reproduce a candidate wheel.

Run the Rust quality gates with the pinned toolchain:

uv run python -m wisp.rpc.protocol_schema --check
cargo fmt --all --check
cargo check --workspace --all-targets --all-features
cargo clippy --workspace --all-targets --all-features -- -D warnings
cargo test --workspace --all-features

Working on these docs

Documentation is a static Astro site with Pagefind search. Use Node 22.22.1 and npm 10.9.4:

cd site
npm ci
npm run dev

Open the printed URL including /Wisp/. Markdown and navigation metadata live together in site/src/content/pages/; root CHANGELOG.md remains the only release-notes source. Tutorial code is included from examples/crafting_agents/ rather than copied into pages.

Before proposing a documentation change:

# From site/
npm test
npm run check
npm run format:check
npm run build
npm exec playwright install chromium
npm run test:browser
# From the repository root
uv run pytest tests/docs tests/repository/test_images.py

Output goes to ignored site/dist/. The build checks actual files, local links and fragments, legacy URLs and anchors, and the combined /Wisp/print.html view. Browser tests exercise the built site, including real search, themes, diagrams, keyboard use, and mobile/no-JavaScript navigation.

The Docs workflow is the only build/deploy path and publishes site/dist through GitHub Pages. After deployment it checks the exact revision at the public base path before running browser smoke tests. See the site guide and cutover procedure for details.