Contributing to DaemonEye

Thank you for your interest in contributing to DaemonEye! This guide will help you get started with contributing to the project.

Getting Started

Prerequisites

Before contributing to DaemonEye, ensure you have:

Fork and Clone

  1. Fork the repository on GitHub
  2. Clone your fork locally:
git clone https://github.com/your-username/daemoneye.git
cd daemoneye
  1. Add the upstream repository:
git remote add upstream https://github.com/EvilBit-Labs/daemoneye.git

Development Setup

  1. Install dependencies:
just setup
  1. Run tests to ensure everything works:
just test
  1. Build the project:
just build

Development Environment

Project Structure

DaemonEye/
├── procmond/ # Process monitoring daemon
├── daemoneye-agent/ # Agent orchestrator
├── daemoneye-cli/ # CLI interface
├── daemoneye-lib/ # Shared library
├── docs/ # Documentation
├── tests/ # Integration tests
├── examples/ # Example configurations
├── justfile # Task runner
├── Cargo.toml # Workspace configuration
└── README.md # Project README

Workspace Configuration

DaemonEye uses a Cargo workspace with the following structure:

[workspace]
resolver = "2"
members = [
  "procmond",
  "daemoneye-agent",
  "daemoneye-cli",
  "daemoneye-lib",
]

[workspace.dependencies]
tokio = { version = "1.0", features = ["full"] }
clap = { version = "4.6.0", features = ["derive", "completion"] }
serde = { version = "1.0", features = ["derive"] }
sqlx = { version = "0.7", features = ["runtime-tokio-rustls", "sqlite"] }
sysinfo = "0.30"
tracing = "0.1"
thiserror = "1.0"
anyhow = "1.0"

Development Commands

just setup # Setup development environment
just build # Build the project
just test # Run tests
just lint # Run linting
just fmt # Format code
just bench # Run all workspace benchmarks
just bench-procmond # Run procmond benchmarks (WAL, EventBus, process collection, serialization)
just docs # Generate documentation
just clean # Clean build artifacts

Commit Signing and GPG Setup

Workspace tooling enforces signed commits (git.enableCommitSigning) and a rebase-first sync strategy. Configure GPG before making changes to avoid commit failures.

  1. Install GnuPG
    • macOS: brew install gnupg pinentry-mac
    • Linux: install gnupg and an appropriate pinentry package via your package manager
    • Windows: install Gpg4win and enable the GPG Agent during setup
  2. Generate a signing key (4096-bit RSA recommended)
gpg --full-generate-key
  1. Locate the long key ID
gpg --list-secret-keys --keyid-format=long
  1. Export the public key for review systems
gpg --armor --export <KEY_ID> > ~/.gnupg/daemoneye.pub
  1. Configure Git to sign by default
git config --global user.signingkey <KEY_ID>
git config --global commit.gpgsign true
git config --global tag.gpgsign true
git config --global gpg.program $(command -v gpg)
  1. Ensure the GPG agent is active
    • macOS: add pinentry-program /opt/homebrew/bin/pinentry-mac to ~/.gnupg/gpg-agent.conf, then run gpgconf --kill gpg-agent
    • Windows: restart the "GnuPG Agent" service from the Gpg4win config utility
    • Linux: ensure gpg-agent starts from your desktop session
  2. Verify signing works
echo "test" | gpg --clearsign
git commit --allow-empty -S -m "test: verify signing"

Code Standards

Rust Standards

DaemonEye follows strict Rust coding standards:

  1. Edition: Always use Rust 2024 Edition
  2. Linting: Zero warnings policy with cargo clippy -- -D warnings
  3. Safety: unsafe_code = "forbid" enforced at workspace level
  4. Formatting: Standard rustfmt with 119 character line length
  5. Error Handling: Use thiserror for structured errors, anyhow for error context

Naming Conventions

Testing Requirements

Test Coverage

All code must have comprehensive test coverage:

Running Tests

cargo test # Run all tests
cargo test test_process_collection # Run specific test
cargo test -- --nocapture # Run tests with output
cargo test --test integration # Run integration tests
cargo bench # Run benchmarks
cargo fuzz run process_info # Run fuzz tests

Pull Request Process

Before Submitting

  1. Sync with upstream:
git fetch upstream
git checkout main
git merge upstream/main
  1. Create a feature branch:
git checkout -b feature/your-feature-name
  1. Make your changes: Write code following the coding standards, add comprehensive tests, update documentation, run all tests and linting
  2. Commit your changes:
git add .
git commit -m "feat: add new feature description"

Commit Message Format

Use conventional commits format:

<type>[optional scope]: <description>

[optional body]

[optional footer(s)]

Pull Request Guidelines

  1. Title: Clear, descriptive title
  2. Description: Detailed description of changes
  3. Tests: Ensure all tests pass
  4. Documentation: Update relevant documentation
  5. Breaking Changes: Clearly mark any breaking changes
  6. Related Issues: Link to related issues

Issue Reporting

Bug Reports

When reporting bugs, please include:

  1. Environment: OS, Rust version, DaemonEye version
  2. Steps to Reproduce: Clear, numbered steps
  3. Expected Behavior: What should happen
  4. Actual Behavior: What actually happens
  5. Logs: Relevant log output
  6. Screenshots: If applicable

Feature Requests

When requesting features, please include:

  1. Use Case: Why is this feature needed?
  2. Proposed Solution: How should it work?
  3. Alternatives: Other solutions considered
  4. Additional Context: Any other relevant information

Community Guidelines

Code of Conduct

We are committed to providing a welcoming and inclusive environment for all contributors. Please:

Communication

Development Workflow

Branch Strategy

Continuous Integration

All pull requests must pass: Unit tests, Integration tests, Linting checks, Security scans, Performance benchmarks, Documentation builds.

License

By contributing to DaemonEye, you agree that your contributions will be licensed under the same license as the project (Apache 2.0 for core features, commercial license for business/enterprise features).

Thank you for contributing to DaemonEye! Your contributions help make the project better for everyone.