- CMake 3.16+
- C++17 compiler (see platform notes below)
- Git
Linux
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Debug
cmake --build . -j$(nproc)
ctest --output-on-failureWindows (MSYS2 UCRT64)
mkdir build && cd build
cmake .. -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Debug
mingw32-make -j4
ctest --output-on-failureSee docs/WINDOWS_SETUP.md if Defender blocks executables.
The project uses clang-format with the config in .clang-format (LLVM style, indent width 4, column limit 120). Format before committing:
clang-format -i src/*.cpp include/guardian/*.hppinclude/guardian/ Public headers — the API surface
src/ Implementation files
tests/unit/ Unit tests (Catch2) and property tests (RapidCheck)
tests/performance/ Benchmark tests
examples/ Standalone usage examples
policies/ Example policy JSON files
docs/ Documentation
Each header in include/guardian/ has a corresponding .cpp in src/. Ownership comments at the top of each file indicate which dev originally wrote it (for context, not strict ownership).
All changes must keep the full test suite passing:
ctest --output-on-failure13 test targets:
| Target | What it covers |
|---|---|
test_session_manager |
Session isolation, sequence tracking |
test_policy_validator |
Transitions, cycles, exfiltration, path validation, caching |
test_logger |
Level filtering, JSON export, file output, thread safety |
test_visualization |
DOT colours, sequence styling, ASCII legend, summary |
test_cli |
Interactive CLI flows |
test_sandbox_manager |
Sandbox lifecycle |
test_wasmedge |
WebAssembly runtime integration |
test_tool_interceptor |
Validator + sandbox coordination |
test_integration_demos |
End-to-end scenarios |
bench_policy_graph |
Graph operation performance |
bench_visualization |
Rendering performance |
bench_sandbox |
Sandbox execution performance |
bench_validator |
Validation latency, throughput, concurrency |
When adding a new feature, add tests to the relevant unit test file. For new public API, add to tests/unit/. For performance-sensitive code, add to the relevant bench file.
Use conventional commits:
feat(component): short description
fix(component): short description
refactor(component): short description
test(component): short description
docs: short description
build: short description
chore: short description
Keep commits atomic — one logical change per commit. Do not bundle unrelated changes.
- Add the detection method to
include/guardian/policy_validator.hpp. - Implement it in
src/policy_validator.cpp. - Call it from
validate()in the appropriate order (after transition check, before cache store). - Add unit tests in
tests/unit/test_policy_validator.cpp.
- Add the value to the
NodeTypeenum ininclude/guardian/types.hpp. - Update
PolicyGraph::from_json/to_jsoninsrc/policy_graph.cppto handle the new string. - Update
node_fill_colorandnode_type_abbrinsrc/visualization.cpp. - Update the policy guide in
docs/policy_guide.md.
- Target the
mainbranch. - All tests must pass.
- Include a brief description of what changed and why.
- If it fixes a bug, describe how to reproduce the bug before the fix.