Thank you for contributing to NetPulse! NetPulse aims to make network understanding accessible to everyone without sacrificing technical depth. Contributions of code, dissectors, detectors, visualizers, lessons, and documentation are all welcome.
- Review
ARCHITECTURE.mdto understand the core vision, system architecture, technology stack, and repository layering rules. - Every feature must satisfy the Feature Acceptance Filter:
- It must answer at least one of the six fundamental questions:
- What happened?
- Why did it happen?
- What is happening right now?
- What happens next?
- What does it mean?
- What should I do?
- It must satisfy all hard constraints: local-first, observe-only, honest confidence, budgeted performance, and progressive disclosure.
- It must answer at least one of the six fundamental questions:
Find the layer appropriate for your change:
| Goal | Primary Location | Key Concepts |
|---|---|---|
| Add or improve a protocol dissector | crates/netpulse-decode & fuzz/ |
Zero-copy parsing, explanation keys, fuzzing |
| Add a security or anomaly detector | crates/netpulse-intel |
Rules engine, calibrated confidence, evidence links |
| Create a visualization primitive | ui/packages/viz |
WebGL/Canvas, D3 scales, 60 fps target |
| Add or modify a UI screen | ui/app/src/screens |
Progressive disclosure, responsive layouts |
| Write an interactive lesson | crates/netpulse-learn |
Grounded learning, website loading journeys |
| Support OS platform features | crates/netpulse-platform |
Socket attribution, platform isolation, raw capture |
| Extend export capabilities | plugins/ & netpulse-plugin |
Export plugin seam, strict privacy controls |
- Implement Dissector: Open
crates/netpulse-decode/src/and create a new module implementing the protocol parser. - Zero-Copy & Safety: Parse using byte slices (
&[u8]) without unnecessary allocations. Ensure#![forbid(unsafe_code)]or justify any unsafe usage. - Explanation Keys: Assign stable explanation keys to key fields (e.g.,
dns.qtype,tls.sni) so the education engine (netpulse-learn) and AI backend can link explanations. - Add Unit Tests & Fixtures: Place sample capture files in
fixtures/and write unit tests innetpulse-decode. - Add Fuzz Target: Create a corresponding
cargo-fuzztarget infuzz/fuzz_targets/to ensure hostile byte inputs never crash the engine.
- Implement Detector: Open
crates/netpulse-intel/src/rules.rsand create a new rule implementing theDetectortrait. - Evidence Invariant: Every
Findingreturned must include immutable evidence references (flow_id,packet_id, orsession_id). Findings without evidence are invalid. - Calibrated Confidence: Assign a confidence score (
Low,Medium,High,Certain) based on factual signal strength — never overstate findings. - Add Tests: Write unit tests asserting both detection on malicious traffic and false-positive resilience on normal traffic.
- Modify DTOs: Update Rust types in
crates/netpulse-api/src/dto.rs. - Regenerate TypeScript Contract:
cargo test -p netpulse-api -- --ignored write_contract - Verify Contract: Run typechecking across the UI workspace:
pnpm --filter @netpulse/contract typecheck
- Design System: Use tokens, typography, and colors from
@netpulse/design-system. Never hardcode ad-hoc hex colors. - Progressive Disclosure: Respect the user's selected depth level (
Beginner,Intermediate,Expert). - Visual Density: Ensure data density scales smoothly without layout breakage across window sizes.
Run these commands before pushing any commits:
# 1. Rust Formatting
cargo fmt --all --check
# 2. Rust Linter
cargo clippy --workspace --all-targets -- -D warnings
# 3. Rust Workspace Tests
cargo test --workspace
# 4. Documentation Status & Link Verification
python scripts/verify_docs_status.py
# 5. TypeScript Contract & Application Checks
pnpm --filter @netpulse/contract typecheck
pnpm --filter @netpulse/app typecheckDocumentation must strictly reflect the current implementation state of the source code. Whenever a pull request changes the maturity status of a crate or capability (e.g. implementing live capture or SQLite storage):
- Audit crate code and update
docs/status.yml. - Update status tables in
README.md,ARCHITECTURE.md,docs/README.md, andcrates/README.md. - Run
python scripts/verify_docs_status.pyto confirm zero drift and zero broken links before opening a PR.
NetPulse intentionally pins Rust 1.96.0 to match rust-toolchain.toml and Cargo.toml (workspace.rust-version).
Whenever upgrading the Rust toolchain version, maintainers must update all synchronized locations together:
rust-toolchain.toml(channel = "1.9X.0")Cargo.toml(workspace.rust-version = "1.9X") andsrc-tauri/Cargo.toml.github/workflows/ci.yml(toolchain: 1.9X.0inrustandauditjobs)- Run full local quality gates (
cargo fmt,cargo clippy,cargo test) - Regenerate
Cargo.lockonly if dependency resolution changes require it
NetPulse maintains two independent Cargo lockfiles:
- Root Workspace:
Cargo.lock(governscrates/*andplugins/*). - Desktop Shell:
src-tauri/Cargo.lock(governssrc-tauri).
src-tauri is intentionally excluded from the root workspace (exclude = ["src-tauri", "fuzz"] in root Cargo.toml) so that pure-Rust CI jobs can run fast and headless without requiring platform webview system dependencies.
- Root Dependency Updates: Modifies root
Cargo.lock. - Desktop Shell Dependency Updates: Modifies
src-tauri/Cargo.lock. - Workspace Path Dependency Interface Changes: Shared crate changes may legitimately update both
Cargo.lockandsrc-tauri/Cargo.locksimultaneously. - Immutability Enforcement: Both lockfiles are tracked in Git, audited independently in CI (
cargo auditandcargo deny), receive weekly Dependabot updates, and must remain committed. Neither lockfile should ever be deleted or untracked.
- No Upward Dependencies: Never introduce a dependency from a lower crate to a higher crate.
- Dependency Minimization: Third-party dependencies are attack surface. Prefer audited, standard Rust crates.
- Egress Isolation: No new dependency may introduce background network calls. All outbound network traffic is restricted to
netpulse-ai.
- Commit Messages: Write clear, descriptive commit titles and bodies explaining why a change was made.
- CI Readiness: Ensure all local quality gate checks pass cleanly before opening a pull request.