Thanks for your interest in contributing to AI-BOM! This guide covers the development setup, quality standards, and pull request process.
git clone https://github.com/Trusera/ai-bom.git
cd ai-bom
python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"All code must pass three quality gates before merging:
# Auto-format
ruff format src/ tests/
# Lint check (must pass with zero errors)
ruff check src/ tests/Enforced rule sets: E, F, I, W, S, B, C4, UP, SIM, N, RUF
| Rule Set | Purpose |
|---|---|
| E, W | pycodestyle errors and warnings |
| F | pyflakes |
| I | isort import ordering |
| S | flake8-bandit security checks |
| B | flake8-bugbear |
| C4 | flake8-comprehensions |
| UP | pyupgrade |
| SIM | flake8-simplify |
| N | pep8-naming |
| RUF | ruff-specific rules |
mypy src/ai_bom/ --ignore-missing-importsStrict mode is enabled: disallow_untyped_defs = true. All new functions must have type annotations.
# Run all tests
pytest -v
# Run with coverage (must meet 80% threshold)
pytest -v --cov=ai_bom --cov-report=term-missing
# Run a specific test file
pytest tests/test_cli.py -vCoverage threshold: 80%. New code should include tests.
ruff format src/ tests/
ruff check src/ tests/
mypy src/ai_bom/ --ignore-missing-imports
pytest -v --cov=ai_bomsrc/ai_bom/
cli.py # Typer CLI entry point
config.py # Detection patterns (data-driven)
models.py # Pydantic v2 data models
scanners/ # 13 auto-registered scanner plugins
detectors/ # Pattern registries (LLM, model, endpoint)
reporters/ # 9 output formatters (CycloneDX, SARIF, HTML, etc.)
compliance/ # EU AI Act, OWASP, license compliance modules
dashboard/ # FastAPI web dashboard
utils/ # Risk scoring and helpers
tests/ # Mirror of src/ structure
- Create a new file in
src/ai_bom/scanners/(e.g.,my_scanner.py) - Subclass
BaseScanner-- auto-registration happens via__init_subclass__ - Implement
scan(path) -> list[AIComponent] - Add detection patterns to
config.pyif applicable - Import your scanner module in
src/ai_bom/scanners/__init__.py - Add tests in
tests/test_scanners/
- Fork the repo and create a feature branch from
main - Make your changes with tests
- Ensure all three quality gates pass:
ruff check src/ tests/-- zero errorsmypy src/ai_bom/ --ignore-missing-imports-- zero errorspytest -v --cov=ai_bom-- all tests pass, coverage >= 80%
- Submit a PR with a clear description
- CI runs lint + type check + tests on Python 3.10-3.13
Use GitHub Issues with the provided templates:
- Bug Report -- for errors and unexpected behavior
- Feature Request -- for new scanners, reporters, or capabilities
- Detection Pattern -- for new AI SDK or model patterns