Thank you for your interest in contributing to QuantumOS! This guide will help you get started with contributing to this next-generation quantum-aware operating system.
- Code of Conduct
- Getting Started
- Development Workflow
- Coding Standards
- Testing Requirements
- Pull Request Process
- Issue Guidelines
- Security
QuantumOS is an AI-collaborative project where multiple AI models contribute alongside human developers. This section establishes guidelines to prevent drift and ensure quality across AI contributors.
Before submitting ANY code, AI contributors MUST complete these verifications:
# REQUIRED: Run before every PR
./scripts/check-api-consistency.sh- All function calls reference functions that ACTUALLY EXIST in headers
- Function signatures match declarations exactly
- Return types are handled correctly
- No "phantom" functions (calling APIs that don't exist)
# REQUIRED: Must pass before PR
make clean && make- Code compiles without errors
- No new warnings introduced
- All dependencies declared in headers
- Code examples in docs match actual API
- No references to non-existent functions
- When fixing code, also fix related docs
Based on observed issues in this project:
Pattern 1: Phantom API Calls
// WRONG - These functions don't exist!
ipc_create_queue(pid, &queue_id);
ipc_destroy_queue(queue_id);
// CORRECT - Use the ACTUAL API from ipc.h
ipc_process_init(pid);
ipc_process_cleanup(pid);Prevention: READ the header file before calling functions from it.
Pattern 2: Incomplete Fixes Claiming to fix something but only partially doing so (e.g., fixing code but not docs). Prevention: After making a fix, grep for the old pattern everywhere.
Pattern 3: Assumed Context Assuming functions exist based on naming conventions without verifying. Prevention: Always verify by reading actual source files.
type(scope): description
Detailed explanation of changes.
AI-Contributor: Model-Name/Version
AI-Confidence: high|medium|low
AI-Verified: api-check,compile,docs
Co-Authored-By: Model Name <noreply@provider.com>
AI-Contributor: Model name (Claude-Opus-4.5, GPT-4, Gemini-3, etc.) AI-Confidence: Self-assessed confidence level AI-Verified: Comma-separated verifications performed
AI contributions are tracked with these metrics:
| Metric | Target | Description |
|---|---|---|
| API Accuracy | 100% | Function calls match existing APIs |
| First-Compile Success | 100% | Code compiles on first submission |
| Review Iterations | < 2 | Rounds before merge-ready |
| Doc Consistency | 100% | Docs match implementation |
# Check API consistency (function calls vs declarations)
./scripts/check-api-consistency.sh
# Full pre-PR validation
./scripts/validate-contribution.sh
# Check for common drift patterns
./scripts/lint-check.shWe are committed to providing a welcoming and inclusive environment for all contributors, regardless of:
- Experience level with operating systems
- Familiarity with quantum computing
- Background or identity
- Geographic location
- Use welcoming and inclusive language
- Be respectful of differing viewpoints and experiences
- Gracefully accept constructive criticism
- Focus on what is best for the community
- Show empathy toward other community members
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the project maintainers.
- C programming experience
- Basic understanding of operating systems concepts
- Familiarity with quantum computing concepts (helpful but not required)
- Cross-compilation tools (see Bootstrap Guide)
# Clone the repository
git clone https://github.com/kannaka-labs/QuantumOS.git
cd QuantumOS
# Install dependencies
make install-deps
# Build and test
make && make run- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
- main - the single integration branch; every PR targets it and CI must be green to merge
- feature/* , docs/* , fix/* - short-lived branches, squash-merged into
main - Releases are cut by pushing a
vX.Y.Ztag (matching theVERSIONfile), which fires.github/workflows/release.yml— there is no long-liveddeveloporreleasebranch
Use conventional commits:
feat:- New featuresfix:- Bug fixesdocs:- Documentation changesstyle:- Code style changesrefactor:- Code refactoringtest:- Test additions/changeschore:- Build process or auxiliary tool changes
Examples:
feat(process): add process creation API
fix(memory): resolve page table mapping bug
docs(readme): update installation instructions
- All changes require review
- At least one maintainer approval
- Automated tests must pass
- Documentation must be updated
- Security changes require additional review
- Follow Linux kernel coding style
- Use 4-space indentation (no tabs)
- 80-character line limit where practical
- Comment non-obvious code
- Use descriptive variable names
The repository ships a .clang-format that codifies the
project style (4-space indent, attached braces, right-aligned pointers,
100-column limit, include order preserved). CI enforces it, so format
before committing:
# Format the files you touched
clang-format -i path/to/changed_file.c
# Or check without modifying (what CI runs)
clang-format --dry-run --Werror path/to/changed_file.cCI pins clang-format to 21.1.8 from the PyPI wheel
(pip install clang-format==21.1.8), because the apt version changes its
mind about cast spacing and macro braces between releases (18 and 21
disagreed on five files when ubuntu-latest moved to 26.04, #346). Use the
same version locally; if a different one disagrees, prefer the CI verdict.
Two more static gates run in the build job and fail a PR with a short message; both are
deliberate and both have a one-line fix path:
- ISA baseline (
make ci-isa-baseline, #347): the kernel and the citizens must contain only plain x86-64 instructions (no x86-64-v2/v3), so the ISO boots on the oldest machine the hardware reports cover. A new instruction class means a compiler flag crept in; checkCFLAGS. - Interrupt-flag primitives (
scripts/check_irq_primitives.py, #355): the per-file counts ofcli,sti,pushfqandpopfqin inline asm and.Sfiles must match the table the script carries, up or down (ADR-0005 clause (b), ADR-0033). A new bracket is allowed; cite the ADR-0005 clause it preserves in the PR and update the table in the same change.--printemits the measured table. - qsh help table (
scripts/check_qsh_help.py, #363): every commandexecute()dispatches inuser/qsh.cmust have a row inHELP[]and vice versa, becausehelpandhelp <command>are printed from that table. Adding a shell command means adding its row in the same change.
// Good example
int process_create(const char *name, uint32_t parent_pid, process_t **process)
{
if (!name || !process) {
return -EINVAL;
}
*process = kmalloc(sizeof(process_t));
if (!*process) {
return -ENOMEM;
}
memset(*process, 0, sizeof(process_t));
strncpy((*process)->name, name, sizeof((*process)->name) - 1);
(*process)->parent_pid = parent_pid;
return 0;
}#ifndef FILENAME_H
#define FILENAME_H
#include <kernel/types.h>
#include <kernel/memory.h>
/* Constants */
#define MAX_PROCESSES 1024
/* Type definitions */
typedef struct process process_t;
/* Function declarations */
int process_create(const char *name, uint32_t parent_pid, process_t **process);
#endif /* FILENAME_H */Use Doxygen-style comments:
/**
* @brief Create a new process
*
* @param name Process name (must be null-terminated)
* @param parent_pid Parent process ID
* @param process Output pointer to created process
* @return int 0 on success, negative error code on failure
*
* @note The caller is responsible for freeing the process with process_destroy()
*/
int process_create(const char *name, uint32_t parent_pid, process_t **process);- Unit Tests - Test individual functions in isolation
- Integration Tests - Test component interaction
- System Tests - Test complete workflows
- Performance Tests - Verify performance targets
- Security Tests - Verify security properties
tests/
├── unit/
│ ├── test_memory.c
│ ├── test_process.c
│ └── test_ipc.c
├── integration/
│ ├── test_kernel_services.c
│ └── test_quantum_integration.c
├── system/
│ ├── test_boot_sequence.c
│ └── test_quantum_workloads.c
└── benchmarks/
├── performance.c
└── scalability.c
QuantumOS is a freestanding kernel (-nostdlib), so it is not unit-tested like a library —
gcov cannot instrument it. Assurance comes from serial-log integration gates: the kernel
boots in headless QEMU and CI asserts an un-echoable runtime signal for each feature (the
discipline is ADR-0016).
# The ~60-gate smoke suite: build + boot + assert every feature's runtime signal
make ci-smoke
# Boot the in-kernel test citizen and grep its PASS/FAIL
make test
# Targeted gates (see the Makefile for the full ci-smoke-* list)
make ci-smoke-disk # persistence: two boots, one disk
make ci-smoke-mcp # the host MCP toolbox against a live VM
make ci-smoke-society3 # N kernels synchronize one field- All new features must include tests
- Test coverage must be > 80%
- All tests must pass before merge
- Performance tests must meet targets
- Update Documentation - Ensure docs reflect changes
- Add Tests - Cover new functionality with tests
- Check Style - Run code style checks
- Test Locally - Verify all tests pass
- Update Changelog - Add entry to CHANGELOG.md
Use the provided PR template:
## Description
Brief description of changes
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change
- [ ] Documentation update
## Testing
- [ ] Unit tests pass
- [ ] Integration tests pass
- [ ] Manual testing completed
## Checklist
- [ ] Code follows style guidelines
- [ ] Self-review completed
- [ ] Documentation updated
- [ ] Tests added/updated- Automated Checks - CI/CD pipeline runs tests
- Code Review - Maintainers review code changes
- Security Review - Security-sensitive changes get extra review
- Integration Testing - Changes tested in integration environment
- Approval - Maintainer approval required for merge
Use appropriate issue templates:
- Bug Report - For reporting bugs
- Feature Request - For proposing new features
- Quantum Component - For quantum-specific issues
bug- Bug reportsenhancement- Feature requestsdocumentation- Documentation issuessecurity- Security issuesperformance- Performance issuesquantum- Quantum-specific issuesgood first issue- Good for newcomershelp wanted- Community help needed
Include:
- Clear description of the problem
- Steps to reproduce
- Expected vs actual behavior
- System information
- Relevant logs/output
Include:
- Problem statement
- Proposed solution
- Alternatives considered
- Additional context
- Security vulnerabilities should be reported privately
- Do not open public issues for security problems
- Security team will investigate and respond
- Security patches will be coordinated
Email: security@quantumos.dev Include "Security Vulnerability" in subject line
- All security changes require review
- Use secure coding practices
- Regular security audits
- Dependency vulnerability scanning
- GitHub Issues - Bug reports and feature requests
- GitHub Discussions - General questions and discussions
- Documentation - Technical documentation and guides
- Check existing issues and discussions
- Read documentation thoroughly
- Ask specific, well-researched questions
- Be patient and respectful
Contributors are recognized in:
- CONTRIBUTORS.md file
- Release notes
- Project documentation
Thank you for contributing to QuantumOS! 🚀
By contributing to QuantumOS, you agree that your contributions will be licensed under the GNU GPL v2 license.