Thank you for your interest in contributing to Tokenless! This document provides guidelines and workflows for contributors.
This project follows a standard open-source code of conduct. Be respectful, constructive, and inclusive.
- Rust toolchain >= 1.85 (see
rust-toolchain.toml) cargo-auditandcargo-denyfor security checks
git clone https://github.com/TokenFleet-AI/tokenless
cd tokenless
make setupCheck GitHub Issues for open tasks. Comment to claim one.
git checkout -b feat/your-feature-name
# or: fix/your-bug-fix
# or: docs/your-doc-improvementBranch naming convention: {type}/{short-description} where type is feat, fix, docs, refactor, perf, test, or chore.
Follow the project conventions:
- Rust 2024 edition with all clippy pedantic lints enabled
#![forbid(unsafe_code)]at crate roots (exceptions documented perunsafeblock)- Builder pattern for configurable types
thiserrorfor library errors,anyhowfor application errors- No
unwrap()/expect()in production code - All public items require doc comments
- Use
tracingfor logging, neverprintln!/dbg!
make build # Release build
make test # All tests (257+)
make lint # fmt + clippy + cargo-auditAlways run make lint before committing. Clippy pedantic warnings are errors.
Keep commits focused and atomic. Write descriptive commit messages:
feat: add semantic-aware compression engine
Implements a 3-tier architecture with rule-based, ONNX, and
remote API fallback. Closes #42.
- Title matches commit style:
{type}: {description} - Description explains what and why, with test plan
- Link related issues
crates/tokenless-schema/ # Core compression library
src/
schema_compressor.rs # OpenAI Function Calling schema compression
response_compressor.rs # JSON API response compression
shape_analyzer.rs # JSON structure analyzer
format_router.rs # Intelligent encoding strategy selector
encoding/ # TOON HRV, Enhanced TOON, CJSON compact
crates/tokenless-stats/ # SQLite compression metrics tracking
crates/tokenless-cli/ # CLI binary + MCP server + env checker
adapters/tokenless/ # Agent plugin adapters (OpenClaw, Hermes)
- Unit tests: same file under
#[cfg(test)] mod tests - Integration tests:
crates/*/tests/ - Name tests
test_should_...for clarity - Cover error paths alongside happy paths
- Use
rstestfor parameterized cases,proptestfor invariants
- Keep README.md (English) and README.zh.md (Chinese) in sync
- Spec documents go in
specs/with sequential numbering - User-facing guides go in
docs/ - Update
docs/index.mdandspecs/index.mdwhen adding documents - Public API items need doc comments with
# Errors,# Panics, or# Safetysections
Releases follow semantic versioning via release-please. The maintainer will:
- Run
release-pleaseto generate the release PR - Verify CHANGELOG.md updates
- Publish to crates.io and GitHub Releases
- Open a GitHub Discussion
- Check
specs/for design rationale - Check
docs/for usage guides