Thanks for your interest in Napaxi. This guide covers how to set up a working environment, the boundaries the codebase enforces, and how to get a change landed.
For project-wide rules and AI-tool guidance see AGENTS.md. For
architecture context see docs/architecture.md.
This project adheres to the Contributor Covenant. By participating you agree to uphold it.
Do not open a public GitHub issue for security vulnerabilities. Follow the
process in SECURITY.md.
You will need:
- Rust toolchain (stable, edition 2024, rust-version ≥ 1.92). Install
cargo, then runrustup target addfor any mobile targets you plan to build (e.g.aarch64-linux-android,aarch64-apple-ios). - Flutter SDK ≥ 3.19 with Dart ≥ 3.3 for any change under
packages/flutter/orexamples/flutter/. ripgrep(rg) — the boundary checker uses it.- For mobile native builds: Android NDK and/or Xcode command-line tools, see
docs/sdk-integration.md.
Clone and verify:
git clone <repo-url> napaxi
cd napaxi
cargo check --manifest-path crates/core/Cargo.toml
./tools/scripts/build.sh check-boundary| Path | Purpose |
|---|---|
crates/core/ |
Rust runtime kernel and adapter-facing API (napaxi_core::api). |
crates/features/* |
Feature-domain crates consumed by core. Must not depend on core. |
packages/api_bridge/ |
Flutter Rust Bridge / FFI binding layer over napaxi_core::api. |
packages/flutter/ |
Flutter adapter package (napaxi_flutter). |
packages/agent_provider/ |
Provider-side SDK for Agent App actions. |
examples/flutter/ |
Flutter integration demo that consumes the SDK as a host app would. |
examples/provider_app/ |
Sample provider apps for Agent App actions. |
vendor/ |
Third-party patched dependencies (e.g. libsql-patched). |
tools/scripts/ |
Build, codegen, hygiene, and packaging helpers. |
docs/ |
Architecture, integration, and design notes. |
Where to put new code:
- Reusable runtime behavior →
crates/. - Adapter and host integration →
packages/. - Demo-only UI, state, panels →
examples/. - Build, codegen, hygiene scripts →
tools/scripts/. - Durable design notes →
docs/.
Napaxi enforces a few hard rules. The script
./tools/scripts/build.sh check-boundary turns each into a compile-time
or rg-level check. The most important:
- Adapters enter Rust through
napaxi_core::api::*. Do not importnapaxi_core::mobile_*,napaxi_core::android_assets,napaxi_core::android_linux_env, ornapaxi_core::ios_qemu_envfrompackages/. - Packages must not depend on feature crates directly. Feature behavior
reaches adapters through
napaxi_core::api. - Feature crates must not depend on
crates/core. - Third-party patched crates live under
vendor/, not undercrates/core/orcrates/features/. api/modules export an explicit whitelist; nopub use crate::mobile_*::*globs.- Generated bridge files (
packages/flutter/lib/generated/,packages/api_bridge/generated/frb_generated.rs,packages/flutter/ios/Classes/frb_generated.h) are owned by codegen and must not be edited by hand.
Adding a new cross-cutting feature (LLM provider, built-in tool, MCP surface,
platform tool, policy hook, background service)? Define a capability contract
first in crates/core/src/capabilities/ and expose it through
napaxi_core::api::capability. See docs/mobile-capabilities.md.
Any SDK-facing change, including bug fixes and behavior changes, must preserve
adapter parity across Flutter, Android, and iOS. Classify the change and follow
the evidence rules in docs/sdk-adapter-parity.md.
- Open an issue describing the bug or feature before large changes. Small fixes can go straight to a PR.
- Create a topic branch from
main. Branch names likefeat/<area>-<short>,fix/<area>-<short>,refactor/<area>-<short>,chore/<short>,docs/<short>are common in this repo. - Make focused commits. Use imperative, scoped messages, e.g.:
feat(core): add capability admission for browser toolfix(flutter): debounce capability profile updatesrefactor(core): split mcp/oauth into discovery and token modulesdocs(architecture): clarify adapter boundary rules
- Run the local verification commands below.
- Push and open a PR against
main. Link the issue and describe the user impact and test plan. - Complete the applicable Contributor License Agreement (CLA) before the PR is
merged. See
CLA.md. - By contributing you agree your work is licensed under GPL-3.0-or-later (see
LICENSE), subject to the CLA requirement above.
Run the smallest useful check first; fall back to the full suite before handoff.
# Rust + boundary
./tools/scripts/build.sh check-boundary
cargo check --manifest-path crates/core/Cargo.toml
cargo test --manifest-path crates/core/Cargo.toml -- --quiet
# Flutter SDK
cd packages/flutter
flutter analyze --no-fatal-infos
flutter test
# Flutter demo
cd examples/flutter
flutter analyze --no-fatal-infos
flutter testPrefer flutter test --plain-name <name> for focused tests when the blast
radius is small. Only use flutter test --no-pub when pubspec.lock is
unchanged and dependencies are already resolved.
For native artifacts:
./tools/scripts/build.sh fast android
./tools/scripts/build.sh fast iosCI runs a coverage workflow (.github/workflows/coverage.yml) and uploads
both lcov reports as build artifacts. To reproduce locally:
# Rust (needs cargo-llvm-cov: `cargo install cargo-llvm-cov --locked`)
# Rust (napaxi-core; the api-boundary floor measures this crate)
cargo llvm-cov --package napaxi-core --lcov --output-path lcov.info
cargo llvm-cov --package napaxi-core report # human-readable summary
# Flutter
cd packages/flutter && flutter test --coverage # writes coverage/lcov.infoTwo regression-catcher coverage floors are enforced in CI (coverage.yml):
tools/scripts/coverage-floor.sh lcov.info— the core public API boundary (crates/core/src/api/), withCORE_API_MIN_LINESandCORE_SRC_MIN_LINESmaintained directly intools/scripts/coverage-floor.sh.tools/scripts/flutter-coverage-floor.sh packages/flutter/coverage/lcov.info— the Flutter SDK lib aggregate, withFLUTTER_SDK_MIN_LINESmaintained directly intools/scripts/flutter-coverage-floor.sh.
Treat these floors as reviewed regression baselines. Raise them when CI reports
a sustainably higher percentage, and lower them only with an explicit review
note explaining the test or instrumentation change. The Rust floor scopes to
napaxi-core rather than --workspace because the vendored
libsql-sqlite3-parser build script can break under cargo llvm-cov's
instrumented target dir, and the api boundary lives entirely in napaxi-core.
- All commits build and pass
check-boundary. - Public Dart SDK surface under
packages/flutter/lib/napaxi_flutter.dartremains stable. If you must break it, call it out explicitly in the PR description and updateCHANGELOG.md. - New capabilities update
crates/core/src/capabilities/, the matchingapi::*wrapper, anddocs/mobile-capabilities.mdtogether. - SDK-facing changes classify the affected contract, update matching adapter
surfaces or explicit unsupported states, and include parity evidence from
docs/sdk-adapter-parity.md. - Generated bridge files are regenerated, not edited by hand. The codegen
command lives in
./tools/scripts/build.sh codegen. - Do not commit local build output, Flutter caches, machine-local absolute paths, or platform-prebuilt artifacts.
Napaxi is licensed under GPL-3.0-or-later. All contributions are accepted under that license. By submitting a contribution you certify that you have the right to do so and that your contribution may be redistributed under GPL-3.0-or-later.
External contributions require a completed Contributor License Agreement before merge. Use the Individual CLA when contributing as yourself, and the Corporate CLA when the contribution is owned or controlled by an employer or other legal entity.
The official Ant Group CLA forms and signing requirements are listed in
CLA.md. Automated CLA enforcement depends on the code hosting
platform; until that check is enabled, maintainers may manually verify CLA
completion before merging external pull requests.
If something is unclear, open a discussion or a draft PR with the question in the description. We would rather answer early than rebuild later.