Gitflow & Workflow
Branch Strategy
Section titled “Branch Strategy”Soma follows a Gitflow branching model adapted for a multi-crate Rust workspace:
main ─────────────────────────────────────────────► (releases) │ └── develop ────────────────────────────────────► (integration) │ ├── feature/core-filter-trait ────────────► (merged to develop) ├── feature/compiler-cache-resolution ────► (merged to develop) ├── feature/runtime-event-bus ────────────► (merged to develop) │ ├── release/0.1.0 ───────────────────────► (merged to main + develop) │ └── hotfix/cache-key-collision ──────────► (merged to main + develop)Branch Types
Section titled “Branch Types”| Branch | Purpose | Base | Merges to |
|---|---|---|---|
main | Production releases. Tagged with versions. | - | - |
develop | Integration branch. Always buildable. | main | - |
feature/<name> | New functionality | develop | develop |
release/<version> | Release preparation | develop | main + develop |
hotfix/<name> | Critical fixes | main | main + develop |
Feature Branch Naming
Section titled “Feature Branch Naming”Feature branches follow the pattern: feature/<crate>-<description>
Examples:
feature/core-filter-traitfeature/core-search-dimensionsfeature/compiler-topological-sortfeature/compiler-cache-resolverfeature/runtime-executorfeature/runtime-bayesian-samplerfeature/python-filter-bindings
Commit Conventions
Section titled “Commit Conventions”Commits follow Conventional Commits with crate scope:
<type>(<scope>): <description>
[optional body]
[optional footer]| Type | Usage |
|---|---|
feat | New functionality |
fix | Bug fix |
refactor | Code restructuring without behavior change |
test | Adding or modifying tests |
docs | Documentation changes |
perf | Performance improvement |
ci | CI/CD changes |
chore | Maintenance (deps, tooling) |
Scopes
Section titled “Scopes”Scope matches the crate name:
| Scope | Crate |
|---|---|
core | soma-core |
compiler | soma-compiler |
runtime | soma-runtime |
worker | soma-worker |
memory | soma-memory |
agent | soma-agent |
python | soma-python |
docs | documentation |
Examples
Section titled “Examples”feat(core): add Filter trait with fit/forward lifecyclefeat(core): add SearchDimension enum with Float, Int, Categoricalfeat(compiler): implement topological sort with Kahn's algorithmfix(compiler): handle single-node graphs in parallelism detectiontest(runtime): add integration tests for tiered cache promotionrefactor(core): rename Process to Filter for claritydocs(design): add gradient propagation documentationperf(runtime): use arena allocator for context storePull Request Workflow
Section titled “Pull Request Workflow”Opening a PR
Section titled “Opening a PR”- Create a feature branch from
develop - Implement with TDD (see TDD Strategy)
- Ensure all tests pass:
cargo test --workspace - Ensure clippy is clean:
cargo clippy --workspace - Ensure formatting:
cargo fmt --check - Open PR against
develop
PR Requirements
Section titled “PR Requirements”- Title follows conventional commit format
- Description includes: what, why, and how to test
- All CI checks pass (tests, clippy, fmt, docs)
- At least one approving review
- No merge conflicts with
develop
PR Size
Section titled “PR Size”Prefer small, focused PRs:
- One trait/type per PR in early development
- One module per PR for larger features
- If a PR touches more than 3 crates, consider splitting
Release Process
Section titled “Release Process”- Create
release/<version>fromdevelop - Update
Cargo.tomlversions across workspace - Update CHANGELOG.md
- Run full test suite + manual testing
- Merge to
mainwith version tag - Merge back to
develop - Publish to crates.io (Rust) and PyPI (Python)
Versioning
Section titled “Versioning”Soma follows Semantic Versioning (SemVer):
- 0.x.y: Pre-1.0 development. Breaking changes allowed in minor versions.
- 1.x.y: Stable. Breaking changes only in major versions.
All crates in the workspace share the same version number.
CI/CD Pipeline
Section titled “CI/CD Pipeline”on: [push, pull_request]
jobs: check: - cargo fmt --check - cargo clippy --workspace -- -D warnings - cargo test --workspace - cargo doc --workspace --no-deps
coverage: - cargo tarpaulin --workspace --out xml
python: - maturin build - pytest tests/Development Environment
Section titled “Development Environment”Prerequisites
Section titled “Prerequisites”# Rust toolchainrustup install stablerustup component add clippy rustfmt
# Python (for soma-python development)python -m venv .venvsource .venv/bin/activatepip install maturin pytest
# Documentationcd docs && npm installCommon Commands
Section titled “Common Commands”# Run all testscargo test --workspace
# Run tests for a specific cratecargo test -p soma-core
# Run clippycargo clippy --workspace -- -D warnings
# Format codecargo fmt --workspace
# Build documentationcargo doc --workspace --open
# Build Python packagecd soma-python && maturin develop
# Run docs sitecd docs && npm run dev