Contributing
Development Setup
Section titled “Development Setup”# Clone and installgit clone https://github.com/BigBrotr/bigbrotr.gitcd bigbrotruv sync --group dev --group docs
# Verify everything worksmake ciBranching Model
Section titled “Branching Model”mainis release-ready. Never push directly.developis the integration branch. Never push directly.- All work happens on feature branches created from
develop.
git checkout developgit pull origin developgit checkout -b feat/my-featureBranch Naming
Section titled “Branch Naming”Branch names follow the commit type prefix:
| Prefix | Purpose |
|---|---|
feat/ | New features |
fix/ | Bug fixes |
refactor/ | Code restructuring |
docs/ | Documentation changes |
test/ | Test additions or fixes |
chore/ | Build, CI, dependency updates |
Commit Messages
Section titled “Commit Messages”Conventional Commits format:
feat: add relay timeout configurationfix: handle empty NIP-11 responserefactor: simplify metadata hash computationdocs: update architecture overviewtest: add validator edge case testschore: bump asyncpg to 0.29.0The body explains why, not what. The footer references issues: Closes #123.
Quality Checks
Section titled “Quality Checks”Before committing, run the full CI suite:
make ciThis runs:
| Check | Command | Purpose |
|---|---|---|
| Lint | ruff check src/ tests/ | Code quality (zero errors expected) |
| Format | ruff format --check src/ tests/ | Code formatting |
| Types | mypy src/bigbrotr | Strict type checking |
| Tests | pytest tests/ --ignore=tests/integration/ | Unit tests |
Coverage must stay above 80% (branch coverage).
Code Style
Section titled “Code Style”- Line length: 100 characters
- Target: Python 3.11+
- Formatter/Linter: ruff (replaces black, isort, flake8)
- Type checker: mypy in strict mode
Import Conventions
Section titled “Import Conventions”# Same package: relative importsfrom .logger import Loggerfrom .common.configs import ClearnetConfig
# Cross-package: absolute importsfrom bigbrotr.core.logger import Loggerfrom bigbrotr.models.constants import NetworkTypeParent-relative imports are banned: from ..core import Logger is not allowed.
Architecture Rules
Section titled “Architecture Rules”The diamond DAG must be maintained. Never import upward:
modelsimports only from stdlibcoreimports only frommodelsutilsimports only frommodelsnipsimports fromutilsandmodelsservicesimports fromcore,nips,utils, andmodels
Pull Requests
Section titled “Pull Requests”PRs target develop. Include:
- Clear description of what changed and why
- Link to related issues
- Evidence that
make cipasses
Next Steps
Section titled “Next Steps”- Testing — how to write and run tests.
- Architecture Overview — understand the codebase structure.