Contributing
Predates the current research question (2026-11-02). Written in May 2026 for the earlier Linux-and-RTOS framing on NXP i.MX95; not yet revised. Current state: Home and the repository README.
Thank you for contributing to Haven. This guide covers PR workflow, commit conventions, isolation review, and the review checklist.
Commit conventions
Section titled “Commit conventions”All commits must follow Conventional Commits:
<type>(<scope>): <summary>
[optional body][optional footer: Closes #N]| Type | Use for |
|---|---|
feat |
New feature or capability |
fix |
Bug fix |
docs |
Documentation only |
chore |
Non-functional (CI, deps, formatting) |
test |
New or updated tests |
refactor |
Code restructuring without behaviour change |
perf |
Performance improvement |
security |
Security fix |
Scope examples: stage2, smmu, freertos, timer, ci, website.
PR workflow
Section titled “PR workflow”- Branch from
main:git checkout -b feat/<topic>orfix/<topic>etc. - Implement changes; add or update tests for all behaviour changes.
- Verify locally:
Terminal window make test # all tests passmake style-check # no style issues./scripts/ci/static-analysis.sh # cppcheck + clang --analyze pass - Commit with
--no-verifyonly when bypassing hooks intentionally (benchmark-heavy pre-push for tag/hotfix pushes). - Open PR against
main. Fill in the PR template. - Review: at least one approving review required. Isolation-policy PRs require the isolation guardian.
Isolation guardian checklist
Section titled “Isolation guardian checklist”Any PR touching the following files requires isolation guardian sign-off:
src/core/mm/stage2.c- spatial isolationsrc/core/sched/budget.c- temporal isolationsrc/core/dma/smmu.c- DMA isolationsrc/core/irq/ownership.c- interrupt isolationsrc/core/iommu/iommu_policy.c- IOMMU group isolationinclude/haven/stage2.h,include/haven/smmu.h,include/haven/budget_sched.h- public API contracts
For each changed isolation-policy file, verify:
- [REQUIRED] Every public API function validates
partition_id != 0and all pointer arguments are non-NULL before any state mutation. - [REQUIRED] Negative test added or updated in
tests/integration/test_isolation_negative.ccovering the new rejection path. - [REQUIRED]
docs/safety/ASSUMPTIONS.mdupdated if a new assumption is introduced. - [REQUIRED]
docs/safety/THREAT_MODEL.mdreviewed - does the change affect any threat boundary?
TCB size review
Section titled “TCB size review”Haven targets a core TCB under 5,000 lines of C. Check before merging:
wc -l src/core/**/*.c- Total
src/core/line count stays below 5,000 lines. - Any new file in
src/core/has a justification in the PR description. - New helper code that is not strictly isolation-enforcement lives in
src/common/orsrc/guest/, notsrc/core/.
General PR hygiene
Section titled “General PR hygiene”- PR title follows
<type>(<scope>): <summary>. - Each commit is atomic - one logical change per commit.
- No debug prints left in production paths (unless guarded by a compile-time flag).
- No new compiler warnings with
-Wall -Wextra -Werror. -
CHANGELOG.mdupdated if adding a user-visible change.
Branching model
Section titled “Branching model”| Branch pattern | Purpose | Merge strategy |
|---|---|---|
main |
Always releasable; protected | PR + CI pass required |
feat/* |
New features | Squash merge to main |
fix/* |
Bug fixes | Squash merge to main |
docs/* |
Documentation only | Squash merge to main |
chore/* |
Non-functional changes | Squash merge to main |
release/vX.Y |
Release preparation | Freeze + tag |
Code style
Section titled “Code style”Style is enforced by .clang-format. Run the formatter:
./scripts/dev/format.sh # format all C sources in-place./scripts/dev/style-check.sh # check without modifyingShell scripts are checked with sh -n (POSIX syntax only).
Governance files
Section titled “Governance files”| File | Purpose |
|---|---|
CONTRIBUTING.md |
Contribution workflow and DCO |
SECURITY.md |
Vulnerability reporting |
CODE_OF_CONDUCT.md |
Community standards |
AGENTS.md |
AI agent roles and policies |
docs/safety/THREAT_MODEL.md |
Adversary model and security claims |
docs/safety/ASSUMPTIONS.md |
Hardware and platform assumptions |