First off, thank you for considering contributing to NSE!
- Code of Conduct
- How to Report Bugs
- How to Propose Features
- Development Setup
- Coding Standards
- Architectural Principles
- Testing
- Documentation Requirements
- Developer Certificate of Origin (DCO)
- Pull Request Process
- Security Best Practices for GitHub Actions
By participating in this project you agree to abide by the
Code of Conduct. Report unacceptable behavior to 129986281+onyks-os@users.noreply.github.com.
- Check existing issues — someone may have reported it already.
- Use the issue template and provide as much detail as possible.
- Include diagnostics: version, operating system, exact command, and full output.
- Open an issue using the Feature request template.
- Explain why the feature is needed and how it fits the project's goals, not only what it does.
- Wait for maintainer feedback before investing significant implementation time.
-
Clone the repository:
git clone https://github.com/onyks-os/NetworkSandboxEngine.git cd NetworkSandboxEngine -
Bootstrap the environment:
make setup
-
Install the Git pre-commit hook (runs lint + unit tests before each commit):
make install-hooks
-
Run the test suite:
make test
All contributions must satisfy the following before being submitted. These checks are enforced automatically by the CI pipeline.
- Linting & formatting: the code must pass
make lintwith no errors or warnings. - Shell scripts: everything under
scripts/must passshellcheck. - Type annotations: new functions and methods must be fully annotated, consistent with the existing codebase.
- No dead code: remove unused imports, variables, and commented-out blocks before submitting.
- Commit messages: follow Conventional Commits
(
feat:,fix:,docs:,refactor:,test:,chore:,ci:).
Pull requests that fail
make lintwill not be merged.
These are not style preferences. Each one exists because its absence caused a real defect in this repository.
-
A test that asserts an absence must first demonstrate it can detect a presence.
assert no_leakis also true when the instrument is broken. Every negative assertion needs a paired positive control, and a failing control fails the test. This is the single rule the 2.1.0 release is built around. -
Never fix a bug without adding the check that would have caught it. No exceptions. If the check is hard to write, that is information about the design, not a reason to skip it.
-
A gate that cannot fail is not a gate. Before trusting a check, break the thing it guards and confirm it goes red.
make test-blinddoes exactly this for the oracle, in CI, on every push. -
Silence is the worst failure mode. An unparsed line, a missed event or a dead subprocess must produce an error, not a debug log. If you catch an exception, record why the operation ended - a caller that cannot distinguish "nothing happened" from "I stopped looking" cannot be correct.
-
Single Responsibility Principle (SRP): each module does one thing. Keep presentation logic out of core logic.
-
No UI coupling: core modules must not import the CLI/UI layer. Use callbacks or return raw data.
-
Atomic operations: state-changing operations must be all-or-nothing; never leave the system half-configured.
-
Crash safety: always consider what happens if the process is killed mid-operation.
-
Test-driven development: every new feature or bug fix ships with a corresponding test.
- Unit tests must pass on every pull request. They are fully mocked and require no privileges.
- Integration tests run in a container or VM and verify real system behavior.
- Pull requests: every pull request triggers the CI pipeline — linting, static analysis, and the unit test matrix.
- Push to
main: the same suite runs on any push to the default branch. - Locally: run
make verifybefore opening a pull request.
- Green: ready for review.
- Red: blocks the merge. Review the logs, fix, and push an update.
A change is major if it adds a significant feature, alters a security boundary, or changes the crash-safety architecture. For major changes the contributor must:
- Add new unit tests covering the functionality.
- Update existing tests when the expected behavior changes.
- Run the integration suite manually and report the result in the pull request.
Pull requests are blocked from merging if tests do not sufficiently cover the change.
Every change must keep the documentation in sync with the code. The exact files to update for each
type of change are defined in docs/documentation-policy.md.
At minimum, every user-visible change requires a CHANGELOG.md entry.
By contributing to NSE you certify that you have the right to submit the contribution under the project's MIT license, and you agree to the Developer Certificate of Origin v1.1.
Every commit must include a Signed-off-by line with your real name and email:
Signed-off-by: Jane Doe <jane@example.com>
The easiest way to add it is the -s flag:
git commit -s -m "your commit message"For multiple commits in a branch, sign them off at once:
git rebase --signoff HEAD~<number-of-commits>Pull requests with unsigned commits will not be merged. The DCO check is enforced by CI.
Full DCO text
Developer Certificate of Origin
Version 1.1
Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.
Developer's Certificate of Origin 1.1
By making a contribution to this project, I certify that:
(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or
(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or
(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified it.
(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.
A release is one tag: git push origin vX.Y.Z runs build, signing, GitHub
Release, TestPyPI, an installed smoke test, and PyPI, in that order. Rehearse it
with make release-dry first.
Full procedure, including the one-time Trusted Publishing setup: docs/RELEASING.md.
- Create a branch from
main. - Ensure
make verifypasses locally. - Update the documentation required by
docs/documentation-policy.md. - Fill in the pull request template checklist honestly.
- Submit the pull request and wait for review. Expect a first response within 7 days.
Thank you for your help!
When contributing workflows or modifying CI pipelines, follow these guidelines to prevent injection attacks.
Bad (vulnerable to script injection):
- run: echo "PR title: ${{ github.event.pull_request.title }}"Good (use environment variables):
- env:
PR_TITLE: ${{ github.event.pull_request.title }}
run: echo "PR title: $PR_TITLE"This trigger runs in the context of the base repository and can expose secrets to malicious code from
a fork. Prefer pull_request.
Third-party actions must be pinned to an immutable commit SHA, not a mutable tag:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1Declare the minimum permissions at workflow level:
permissions:
contents: readIf user-provided text must be used, validate it against an allowlist or escape it before passing it to a script.
For actions that execute code from pull requests, run them inside a container with no access to secrets.