Contributing to STRIDE
This guide outlines standards, engineering practices, and verification protocols for contributing to the STRIDE framework.
Development Setup
1. Repository Setup
Fork the repository on GitHub and clone your fork locally:
Configure the upstream remote:
2. Virtual Environment Configuration
Create and activate an isolated Python 3.10+ virtual environment:
Linux / macOS:
Windows (PowerShell):
3. Install Dependencies in Editable Mode
Install the framework along with all development and documentation dependencies:
Architectural Boundaries & Invariants
All contributions must adhere to the following architectural invariants:
- Strict Core / UI Decoupling:
- The core framework under
src/stride/must contain zero Streamlit code. Never importstreamlitor rely on UI session state in algorithmic modules. - Streamlit components, state management, and dashboard widgets belong exclusively under
dashboard/.
- The core framework under
- Headless Visualizations:
- Functions in
stride.plottingmust generate and returnmatplotlib.figure.Figureormatplotlib.axes.Axesobjects. - Never call
plt.show()within library modules, as this blocks execution in non-interactive environments and CI runners.
- Functions in
- Reproducibility & Random Seeds:
- Stochastic operations (data generation, train/test splits, neural autoencoder initialization) must accept a
random_stateorrandom_seedinteger parameter to ensure deterministic execution across benchmark runs.
- Stochastic operations (data generation, train/test splits, neural autoencoder initialization) must accept a
- Exception Handling:
- Library code must raise specific exceptions derived from
StrideError(e.g.DimensionalityError,OptionalDependencyError,DriftDetectionError) rather than generic uncaught runtime exceptions.
- Library code must raise specific exceptions derived from
Git Workflow & Commit Protocol
Branch Invariant
Always branch directly from the latest origin/main:
Allowed branch prefixes:
* feat/ for new features or algorithmic components
* fix/ for bug patches
* refactor/ for structural refactorings without behavioral changes
* docs/ for documentation updates
* test/ for test suite additions
Conventional Commits
Commit messages must strictly follow the Conventional Commits specification:
- Types:
feat,fix,refactor,style,test,docs,chore. - Scope: Noun identifying the affected subsystem (e.g.
api,drift,xai,dashboard,models,datasets,clustering,recurrence). - Format: Imperative, present tense (e.g.,
feat(xai): add conformal abstention to discriminator). - Atomicity: Each commit should solve a single logical problem and maintain passing tests.
Local CI Verification Gates
Before submitting code or pushing branches, all local quality gates must pass cleanly:
# 1. Lint code with Ruff (Google docstrings, D417 parameter completeness)
ruff check .
# 2. Check code formatting with Ruff
ruff format --check .
# 3. Execute automated test suite
python -m unittest discover tests
# 4. Validate documentation builds in strict mode (zero warnings)
mkdocs build --strict
Ensure there are 0 errors, 0 warnings, and 0 test failures before creating a pull request.
Submitting Pull Requests
- Push your feature branch to your GitHub fork:
- Open a Pull Request against
KubaCzech/STRIDE:main. - Fill out the Pull Request template completely, providing:
- Summary of changes.
- Motivation and context (including issue references like
Closes #12). - Explicit confirmation that local verification gates (
ruff,unittest,mkdocs) passed. - Monitor the remote GitHub Actions CI workflows to verify clean execution across all matrix configurations.