Thank you for your interest in contributing. This document describes setup, expectations, and how to run the same checks as CI.
- Code of Conduct
- Getting Started
- Development Setup
- Contributing Guidelines
- Pull Request Process
- Code Standards
- Testing
- Documentation
- Security
- Questions and Support
This project and everyone participating in it is governed by our Code of Conduct. By participating, you are expected to uphold this code.
- Lean —
lean-toolchain; install via elan - Rust —
rust-toolchain.toml(currently 1.88) - Python 3.12+ — bundle tooling via
pyproject.toml - Node.js 18+ — only if you work on
bindings/node; CI validates the crate withcargo check - Go 1.21+ — only if you work on
bindings/go - Docker — optional; see
docker-compose.jepsen.ymland Dockerfiles in the repo root
-
Fork and clone
git clone https://github.com/your-username/security-envelopes.git cd security-envelopes -
Install dependencies
# Lean (elan) curl https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh -sSf | sh # Rust (rustup) curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh # Python (editable install for the bundle package) pip install -e ".[dev]" # Node bindings (optional): align Neon/npm with the crate before `npm install`
-
Build
lake build cargo fmt --check cargo clippy --workspace --all-targets -- -D warnings cargo build
-
Run checks
lake exe test_rbac && lake exe test_tenant && lake exe test_attest cargo test --workspace ruff check bundle scripts tests pytest tests/ -v
Install pre-commit and enable hooks once per clone:
pip install pre-commit
pre-commit install
pre-commit run --all-filesSee docs/ARCHITECTURE.md and the doc index docs/README.md.
- Formal specifications (Lean)
- Policy engine (Rust / WASM)
- Language bindings (Go, Node, Python)
- Compliance bundle and tooling (Python)
- Documentation and tests
- CI and developer experience
- Search existing issues and PRs
- For larger changes, open an issue to agree on direction
- Match existing style and abstractions in the area you touch
-
Branch
git checkout -b feature/your-feature-name
-
Change, test, document — see Testing and Documentation.
-
Verify locally (same categories as CI)
lake build lake exe test_rbac && lake exe test_tenant && lake exe test_attest cargo fmt --check cargo clippy --workspace --all-targets -- -D warnings cargo test --workspace ruff check bundle scripts tests pytest tests/
Optional, when relevant:
cargo deny check cargo audit
-
Commit — Conventional commits are preferred.
-
Push and open a PR against the default branch.
- Clear title and description
- Tests or specs updated when behavior changes
- Docs updated when user-facing behavior or workflows change
- Security-sensitive changes: describe threat model and review needs in the PR
- Automated workflows must pass (see docs/ARCHITECTURE.md)
- Maintainer review as needed for the area
- Prefer small, reviewable changes
- Security-sensitive paths deserve explicit review and tests
- Document public APIs and non-obvious invariants
- Avoid committing secrets, tokens, or large generated artifacts unless the repo already tracks them intentionally
Use clear names and module structure consistent with Spec/. Prefer Mathlib idioms already used in the tree.
The main crate is policyengine (engine/). Use cargo clippy with -D warnings before pushing.
Type hints and ruff/pytest as configured in pyproject.toml.
Conventional style:
type(scope): description
[optional body]
Common types: feat, fix, docs, style, refactor, test, chore.
| Area | Command |
|---|---|
| Lean smoke | lake exe test_rbac, lake exe test_tenant, lake exe test_attest |
| Rust | cargo test --workspace (narrow with cargo test -p policyengine) |
| Python | pytest tests/ |
| Policy YAML | python scripts/policy_lint.py examples/*/policy.yaml |
Chaos / Jepsen helpers under chaos-scripts/ are optional and environment-specific.
Keep these aligned when you change workflows, layout, or formal specs:
| File | Purpose |
|---|---|
| README.md | Overview and quick start |
| docs/README.md | Documentation index |
| docs/ARCHITECTURE.md | Components and CI |
| TRACEABILITY.md | Lean ↔ Rust / automation |
| SECURITY.md | Reporting and supply chain |
| scripts/README.md | Policy linter |
- Do not open public issues for undisclosed vulnerabilities; see SECURITY.md.
- Follow secure dependency practices;
Cargo.lockis tracked for reproducible Rust builds.
Use GitHub issues for bugs and feature requests. For broader design discussion, use GitHub Discussions if enabled on the repository.
Contributors are credited via GitHub and release notes when applicable.
Thank you for contributing.