Static commutativity analysis for parallel changeset integration. Decides whether two (or more) changesets can be safely merged in any order — without running their tests through an integration oracle — using AST-level isolation analysis.
The output is a verdict: STRONG, MEDIUM, WEAK, or ORACLE_REQUIRED. STRONG and MEDIUM verdicts are safe to merge in parallel; WEAK and ORACLE_REQUIRED defer to a build/test oracle.
Wave-pattern execution systems (e.g. claudecode-workflow) integrate many changesets per wave. Without commutativity analysis every parallel merge falls back to the oracle — slow and expensive. With it, ~half can skip the oracle entirely (project-dependent; empirically validated across 4 real codebases).
The probe is the analysis engine. It is invoked by mcp-server-sdlc's commutativity_verify tool, which is in turn called from /nextwave's post-flight merge step.
pip install --user .
# or, in a venv
pip install .The console script commutativity-probe is installed on PATH.
Requires Python 3.11+. Tree-sitter language grammars are pulled in as dependencies (Python, Java, Go, Rust, JavaScript, TypeScript, Bash).
# Analyze two branches against a base ref
commutativity-probe analyze --repo /path/to/repo --base main feature/a feature/b
# JSON output (for tool integration)
commutativity-probe analyze --repo /path/to/repo --base main feature/a feature/b --json
# Manifest-based prediction (no git required)
commutativity-probe predict --manifest --json < manifest.jsonRun commutativity-probe --help for the full subcommand list.
Per pair of changesets, the probe:
- Parses the diff for each branch via tree-sitter
- Extracts symbols touched (functions, classes, top-level statements)
- Computes file-level and symbol-level isolation
- Returns a pairwise verdict; the caller composes verdicts across N changesets
The full theory — Isolation-Composition Equivalence — has its own paper. The empirical results (49% oracle elimination across 4 production codebases) are summarized in companion work.
Early stage. Public-facing API is the CLI; library callers (probe.analyzer, probe.diff_parser, probe.symbols) are subject to change without notice until v1.0.
TBD.