Thank you for your interest in contributing to Amana! This document outlines our contribution guidelines, code ownership policy, and review requirements.
We maintain a CODEOWNERS file (.github/CODEOWNERS) that defines ownership of critical paths in the codebase. This ensures domain expertise is applied to high-impact changes.
The following areas require approval from designated code owners before merging:
- Path:
contracts/amana_escrow/** - Reason: Core escrow logic affecting fund security and dispute resolution
- Owner: @KingFRANKHOOD
- Path:
backend/src/auth/**,backend/src/common/guards/** - Reason: Security-critical authentication and access control
- Owner: @KingFRANKHOOD
- Path:
backend/src/modules/blockchain/**,backend/src/modules/transactions/** - Reason: Contract interaction and transaction integrity
- Owner: @KingFRANKHOOD
- Path:
backend/src/modules/claims/**,backend/src/modules/disputes/** - Reason: Core business logic for trade lifecycle and dispute resolution
- Owner: @KingFRANKHOOD
- Path:
backend/src/common/interceptors/**,backend/src/common/filters/** - Reason: Request tracing, audit logging, and incident debugging
- Owner: @KingFRANKHOOD
- Path:
backend/src/migrations/** - Reason: Schema changes affect all services and data integrity
- Owner: @KingFRANKHOOD
- Path:
frontend/app/components/dashboard/** - Reason: User-facing contract and trade information
- Owner: @KingFRANKHOOD
- Branch Protection: PRs touching owned paths require approval from the designated code owner
- Automatic Checks: GitHub branch protection rules enforce this requirement
- Exceptions: Code owners can approve exceptions for urgent fixes or emergency patches
git checkout -b <type>/<issue-number>-<description>Branch naming conventions:
feat/- New featuresfix/- Bug fixeshardening/- Security or reliability improvementsobservability/- Logging, monitoring, tracinggovernance/- Policy, documentation, ownershiprefactor/- Code improvements without behavior changes
Example:
git checkout -b hardening/e2e-critical-path-tests
git checkout -b observability/request-correlation-audit-logs
git checkout -b governance/codeowners-required-review- Follow the existing code style and patterns
- Write tests for new functionality
- Update documentation as needed
- Ensure all checks pass locally
Use clear, descriptive commit messages:
git commit -m "feat: add E2E tests for critical trade path"
git commit -m "observability: add correlation ID and audit logging"
git commit -m "governance: add CODEOWNERS and review policy"git push origin <your-branch>Then create a PR on GitHub with:
- Clear title describing the change
- Description of what changed and why
- Reference to related issues (e.g.,
Closes #177) - Screenshots or test results if applicable
- Address feedback from code owners
- Ensure all CI checks pass
- Request re-review after making changes
- Required for all new services and utilities
- Run:
npm run test
- Required for critical path changes (trade, dispute, auth)
- Run:
npm run test:e2e
- Required for blockchain and database interactions
- Run:
npm run test:integration
We follow conventional commits for clear history:
<type>(<scope>): <subject>
<body>
<footer>
Types:
feat: New featurefix: Bug fixdocs: Documentationstyle: Code style (formatting, missing semicolons, etc.)refactor: Code refactoringperf: Performance improvementtest: Adding or updating testschore: Build, dependencies, tooling
Scopes:
auth: Authentication moduleblockchain: Blockchain integrationclaims: Claims moduledisputes: Disputes moduleobservability: Logging and tracinggovernance: Code ownership and policy
Examples:
feat(claims): add E2E tests for critical trade path
observability(audit): add request correlation IDs and structured logs
governance: add CODEOWNERS and required review rules
When debugging production issues, use correlation IDs to trace requests:
# Find all logs for a specific request
grep "correlation-id-uuid" logs/*.log
# Trace through database mutations
SELECT * FROM audit_logs WHERE correlation_id = 'uuid' ORDER BY timestamp;
# Check contract events
grep "correlation-id-uuid" contract-events.logSee OBSERVABILITY.md for detailed runbook.
- Never commit secrets or private keys
- Use environment variables for sensitive configuration
- Follow OWASP guidelines for web security
- Report security issues privately to maintainers
- Check existing issues and PRs
- Review the README and documentation
- Ask in discussions or contact maintainers
Thank you for contributing to Amana!