Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Development Documentation

This section contains documentation for developers working on Sage Agent.

🔧 Contents

Getting Started

Contributing

Code Standards

Testing

Architecture & Design

Release Management

🛠️ Development Tools

Required Tools

  • Rust (latest stable) - Primary programming language
  • Cargo - Rust package manager and build tool
  • Git - Version control system
  • IDE/Editor - VS Code, IntelliJ IDEA, or similar

Recommended Tools

  • rust-analyzer - Rust language server
  • clippy - Rust linter
  • rustfmt - Code formatter
  • cargo-watch - Automatic rebuilding
  • cargo-audit - Security vulnerability scanner

Development Scripts

# Build the project
cargo build

# Run tests
cargo test

# Run with logging
RUST_LOG=debug cargo run

# Format code
cargo fmt

# Run linter
cargo clippy

# Check for security vulnerabilities
cargo audit

📋 Project Structure

Workspace Organization

sage-agent/
├── crates/
│   ├── sage-core/      # Core library
│   ├── sage-cli/       # Command-line interface
│   ├── sage-sdk/       # High-level SDK
│   └── sage-tools/     # Built-in tools
├── docs/               # Documentation
├── examples/           # Usage examples
├── configs/            # Configuration templates
└── trajectories/       # Execution trajectories

Module Guidelines

  • Each crate should have a clear, single responsibility
  • Use pub(crate) for internal APIs
  • Minimize dependencies between crates
  • Follow Rust module conventions

🚀 Development Workflow

Feature Development

  1. Create Issue - Describe the feature or bug
  2. Create Branch - Use descriptive branch names
  3. Implement Changes - Follow coding standards
  4. Write Tests - Ensure adequate test coverage
  5. Update Documentation - Keep docs current
  6. Submit PR - Follow PR template
  7. Code Review - Address review feedback
  8. Merge - Squash and merge when approved

Debugging

  • Use RUST_LOG=debug for detailed logging
  • Use cargo test -- --nocapture for test output
  • Use debugger integration in your IDE
  • Add temporary debug prints with dbg!() macro

Performance Profiling

  • Use cargo bench for benchmarking
  • Profile with perf on Linux
  • Use cargo flamegraph for flame graphs
  • Monitor memory usage with valgrind

🔍 Code Quality

Static Analysis

  • Clippy - Rust linter for common mistakes
  • Rustfmt - Consistent code formatting
  • Cargo Audit - Security vulnerability scanning
  • Cargo Deny - License and dependency checking

Testing Requirements

  • Minimum 80% test coverage for new code
  • All public APIs must have tests
  • Integration tests for key workflows
  • Performance regression tests

Documentation Requirements

  • All public APIs must be documented
  • Include usage examples in documentation
  • Keep README files up to date
  • Document architectural decisions

For system architecture details, see the Architecture Documentation. For user-facing documentation, see the User Guide.