Developer Guide¶
Everything you need to contribute to and extend the Fleet Decision Platform.
Getting Started¶
-
Project Structure
Understand the codebase organization.
-
Contributing
How to contribute code and documentation.
-
Testing
Write and run tests effectively.
-
Code Style
Follow coding standards and conventions.
Development Setup¶
Quick Setup¶
# Clone repository
git clone https://github.com/yourusername/fleet-cascade.git
cd fleet-cascade
# Install all dependencies
uv sync --all-extras
# Set up pre-commit hooks
uv run pre-commit install
# Run tests
uv run pytest
Environment Setup¶
Development Workflow¶
graph LR
A[Create Branch] --> B[Write Code]
B --> C[Write Tests]
C --> D[Run Tests]
D --> E{Pass?}
E -->|No| B
E -->|Yes| F[Lint & Format]
F --> G[Create PR]
G --> H[Code Review]
H --> I[Merge]
Branch Naming¶
| Type | Pattern | Example |
|---|---|---|
| Feature | feature/description |
feature/add-prophet-model |
| Bugfix | fix/description |
fix/optimization-timeout |
| Docs | docs/description |
docs/update-api-guide |
| Refactor | refactor/description |
refactor/forecasting-module |
Commit Messages¶
Follow conventional commits:
type(scope): description
feat(forecasting): add Prophet model support
fix(api): handle empty forecast requests
docs(readme): update installation instructions
test(optimization): add constraint validation tests
Common Tasks¶
Running the API¶
Running Tests¶
# All tests
make test
# With coverage
make test-cov
# Specific module
uv run pytest tests/unit/test_forecasting.py -v
Code Quality¶
Architecture Overview¶
src/
├── data/ # Data ingestion & processing
├── forecasting/ # Demand prediction models
├── optimization/ # Fleet allocation engine
├── risk/ # Risk assessment
├── contracts/ # Contract intelligence (Phase 3)
├── explainability/ # Model explanations
├── api/ # FastAPI application
└── utils/ # Shared utilities
Key Design Decisions¶
- Config-driven: All parameters in YAML/JSON files
- Modular: Each capability is a separate module
- Testable: Clear interfaces for unit testing
- Type-safe: Type hints throughout
- MVP-first: Simple implementations, enhance later
Getting Help¶
- Check existing GitHub Issues
- Read the Architecture docs
- Ask in Discussions