Project Maintenance Guide
This skill guides agents and developers on how to maintain the QuanuX project structure as it scales.
1. Build System: CMake Presets (CMakePresets.json)
QuanuX uses CMakePresets.json (version 3) as the source of truth for C++ build configurations. This file allows CLion, Visual Studio, and VSCode to share the same build definitions.
Adding a New C++ Component
When adding a new C++ project (e.g., QuanuX-Rust-Bridge):
- •Define a Configure Preset: Add an entry under
configurePresets.- •Set
binaryDirto${sourceDir}/<Component>/cpp/build. - •Ensure
CMAKE_EXPORT_COMPILE_COMMANDSisON(crucial for LSP/IntelliSense).
- •Set
- •Define a Build Preset: Add an entry under
buildPresets.- •Target the executable name defined in your
CMakeLists.txt.
- •Target the executable name defined in your
2. VSCode Integration (.vscode/)
VSCode configuration is manual but relies on the artifacts generated by CMake.
- •
c_cpp_properties.json:- •CRITICAL: Each configuration must point
compileCommandsto the specific build directory defined inCMakePresets.json. - •Example:
"${workspaceFolder}/execution-node/cpp/build/compile_commands.json" - •Update
includePathto include any new shared headers (e.g.,QuanuX-Common).
- •CRITICAL: Each configuration must point
- •
tasks.json:- •Add build tasks invoking
makeorcmake --buildin the respective directories.
- •Add build tasks invoking
- •
launch.json:- •Add debug configurations for new binaries. Use
lldb(macOS) orgdb(Linux). - •Set
cwdto the binary's build directory to ensure relative paths (like config files) work.
- •Add debug configurations for new binaries. Use
3. Native IDE Support (Xcode & Spyder)
We provide helper scripts in scripts/ to generate native project files.
- •Xcode:
scripts/generate_xcode.sh- •Action: Execute this script after adding a new CMake component to generate the
.xcodeproj. - •Maintenance: If a new component is added, add a
cmake .. -G Xcodeblock for it in the script.
- •Action: Execute this script after adding a new CMake component to generate the
- •Spyder:
scripts/setup_spyder.py- •Action: Run this to initialize
.spyproject. - •Maintenance: If a new Python package is added, ensure specific PYTHONPATH settings are documented or automatable if Spyder requires them (usually standard virtualenv suffices).
- •Action: Run this to initialize
4. NATS & Polyglot Wiring
- •ABI Compatibility: Any shared C++ structs MUST reside in
QuanuX-Commonand use strictly defined types (uint64_t,double). Avoidstd::stringor STL containers in structs passed across ABI boundaries (DLLs/Shared Objects). - •NATS Subjects:
- •Market Data:
market.data.<symbol> - •Simulation:
SIM(Replayed ticks) - •Telemetry:
node.telemetry.<type>
- •Market Data:
5. Directory Structure Sanity
- •
server/: Python-only. Backend logic. - •
execution-node/: C++ Performance Critical. - •
QuanuX-Backtesting-Engine/: C++ Core + Python Bindings. - •
QuanuX-Common/: Pure Headers/Shared Logic. - •
extensions/: 3rd-party integrations (Rithmic, Databento).
Rule: Do not cross-link dependencies (e.g., Server importing Execution Node headers directly) unless via defined Interfaces (Protobuf/NATS/Common Headers).