async-inspect 0.2.0

X-ray vision for async Rust - inspect and debug async state machines
Documentation
# Contributing to async-inspect πŸ”

Thank you for your interest in contributing to async-inspect! We're excited to have you join us in making async Rust debugging better for everyone.

## πŸš€ Project Vision

Make async Rust as easy to debug as synchronous code by providing complete visibility into state machines, execution flow, and task interactions.

## 🀝 Ways to Contribute

### πŸ› Report Bugs

Found a bug? Please [open an issue](https://github.com/ibrahimcesar/async-inspect/issues/new) with:
- Clear description of the problem
- Minimal reproduction code
- Expected vs actual behavior
- Your environment (OS, Rust version, async runtime)

### πŸ’‘ Suggest Features

Have an idea? [Start a discussion](https://github.com/ibrahimcesar/async-inspect/discussions) or open an issue with:
- The problem you're trying to solve
- Your proposed solution
- Why this would be valuable to others
- Potential implementation approach

### πŸ“ Improve Documentation

Documentation improvements are always welcome! This includes:
- Fixing typos or unclear explanations
- Adding examples
- Improving API documentation
- Writing guides or tutorials
- Creating blog posts or videos

### πŸ’» Contribute Code

Code contributions are highly valued! See the development guide below.

## πŸ—οΈ Development Setup

### Prerequisites

- Rust 1.70 or later
- Node.js 20+ (for documentation site)
- Git

### Getting Started

```bash
# Clone your fork
git clone https://github.com/YOUR_USERNAME/async-inspect
cd async-inspect

# Build the project
cargo build

# Run tests
cargo test

# Run examples
cargo run --example basic_inspection

# Run CLI
cargo run --bin async-inspect -- --help

# Build documentation
cargo doc --open
```

### Running Examples

We have many examples demonstrating different features:

```bash
# Basic usage
cargo run --example basic_inspection

# TUI monitor
cargo run --example tui_monitor --features cli

# Relationship graphs
cargo run --example relationship_graph

# Ecosystem integration
cargo run --example ecosystem_integration

# Production configuration
cargo run --example production_ready

# Performance analysis
cargo run --example performance_analysis

# Deadlock detection
cargo run --example deadlock_detection
```

## πŸ“‹ Development Workflow

### 1. Find or Create an Issue

- Check existing issues for something to work on
- Or create a new issue describing what you'd like to add/fix
- Discuss approach before starting large changes

### 2. Create a Feature Branch

```bash
git checkout -b feature/your-feature-name
# or
git checkout -b fix/bug-description
```

### 3. Make Your Changes

- Write clear, idiomatic Rust code
- Follow the existing code style
- Add tests for new functionality
- Update documentation as needed

### 4. Test Your Changes

```bash
# Run all tests
cargo test

# Run specific example
cargo run --example YOUR_EXAMPLE

# Check formatting
cargo fmt --check

# Run clippy
cargo clippy -- -D warnings

# Build with all features
cargo build --all-features
```

### 5. Commit Your Changes

We follow [Conventional Commits](https://www.conventionalcommits.org/):

```bash
git commit -m "feat: add new deadlock detection algorithm"
git commit -m "fix: resolve panic in task tracking"
git commit -m "docs: improve README examples"
git commit -m "chore: update dependencies"
```

Types: `feat`, `fix`, `docs`, `style`, `refactor`, `perf`, `test`, `chore`

### 6. Push and Create Pull Request

```bash
git push origin feature/your-feature-name
```

Then create a PR on GitHub with:
- Clear title describing the change
- Description explaining what and why
- Link to related issues
- Screenshots/examples if relevant

## 🎨 Code Style Guidelines

### Rust Code

- Run `cargo fmt` before committing
- Ensure `cargo clippy` passes with no warnings
- Use descriptive variable and function names
- Add doc comments for public APIs
- Keep functions focused and small
- Prefer clarity over cleverness

### Documentation

- Use clear, concise language
- Include code examples
- Explain the "why" not just the "what"
- Keep examples runnable and tested

### Commit Messages

- Use present tense ("add feature" not "added feature")
- Use imperative mood ("move cursor to..." not "moves cursor to...")
- Reference issues and PRs liberally

## πŸ§ͺ Testing

### Test Requirements

- All new features must have tests
- Bug fixes should include regression tests
- Aim for high code coverage
- Test both success and error cases

### Test Types

```bash
# Unit tests
cargo test --lib

# Integration tests
cargo test --test '*'

# Doc tests
cargo test --doc

# All tests with all features
cargo test --all-features
```

### Example Tests

Add tests to the appropriate module:

```rust
#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn test_task_creation() {
        let task = TaskInfo::new("test".to_string());
        assert_eq!(task.name, "test");
        assert_eq!(task.state, TaskState::Pending);
    }

    #[tokio::test]
    async fn test_async_tracking() {
        // Your async test here
    }
}
```

## πŸ“¦ Project Structure

```
async-inspect/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ lib.rs              # Library entry point
β”‚   β”œβ”€β”€ main.rs             # CLI entry point
β”‚   β”œβ”€β”€ config.rs           # Configuration
β”‚   β”œβ”€β”€ inspector/          # Core inspection logic
β”‚   β”œβ”€β”€ task/               # Task tracking
β”‚   β”œβ”€β”€ timeline/           # Event timeline
β”‚   β”œβ”€β”€ graph/              # Relationship graphs
β”‚   β”œβ”€β”€ deadlock/           # Deadlock detection
β”‚   β”œβ”€β”€ profile/            # Performance profiling
β”‚   β”œβ”€β”€ export/             # Data export
β”‚   β”œβ”€β”€ tui/                # Terminal UI
β”‚   β”œβ”€β”€ integrations/       # Ecosystem integrations
β”‚   β”‚   β”œβ”€β”€ tracing_layer.rs
β”‚   β”‚   β”œβ”€β”€ prometheus.rs
β”‚   β”‚   β”œβ”€β”€ opentelemetry.rs
β”‚   β”‚   └── tokio_console.rs
β”‚   └── reporter/           # Reporting
β”œβ”€β”€ examples/               # Usage examples
β”œβ”€β”€ async-inspect-macros/   # Proc macros
β”œβ”€β”€ docs/                   # Docusaurus site
└── tests/                  # Integration tests
```

## 🎯 Areas for Contribution

### High Priority

- βœ… Core infrastructure (mostly complete)
- βœ… Ecosystem integration (complete)
- πŸ”„ Performance optimization
- πŸ”„ Additional examples
- πŸ”„ Documentation improvements

### Medium Priority

- Advanced deadlock detection algorithms
- Web-based dashboard
- Browser-based timeline viewer
- Additional runtime support (async-std, smol)
- Grafana dashboard templates

### Future Ideas

- VS Code extension
- Chrome DevTools integration
- Distributed tracing support
- AI-powered anomaly detection
- Historical trace diff tool

## πŸ” Code Review Process

### What We Look For

- Correct functionality
- Good test coverage
- Clear documentation
- Following code style
- No breaking changes (or justified ones)
- Performance considerations

### Timeline

- Initial review: Usually within 2-3 days
- Expect iterative feedback
- Most PRs merge within 1-2 weeks

## 🌟 Recognition

All contributors are recognized in:
- README contributors section
- Release notes
- Documentation

We use [All Contributors](https://allcontributors.org/) to track contributions.

## πŸ“œ License

By contributing, you agree that your contributions will be licensed under the MIT License.

## πŸ’¬ Communication

- **GitHub Issues**: Bug reports, feature requests
- **GitHub Discussions**: Questions, design discussions, RFCs
- **Pull Requests**: Code contributions
- **Email**: For security issues, contact ibrahim@ibrahimcesar.com

## πŸ™ Thank You!

Every contribution, no matter how small, helps make async-inspect better. Whether you're fixing a typo, adding a feature, or just providing feedbackβ€”thank you for being part of this project!

## ❓ Questions?

Not sure where to start? Feel free to:
- Open a discussion
- Comment on an existing issue
- Reach out to maintainers

We're here to help! πŸš€