Skip to content

Wave-Engineering/commutativity-probe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

commutativity-probe

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.

What it's for

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.

Install

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).

Usage

# 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.json

Run commutativity-probe --help for the full subcommand list.

How it works

Per pair of changesets, the probe:

  1. Parses the diff for each branch via tree-sitter
  2. Extracts symbols touched (functions, classes, top-level statements)
  3. Computes file-level and symbol-level isolation
  4. 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.

Status

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.

License

TBD.

About

Static commutativity analysis for parallel changeset integration. AST-level isolation analysis via tree-sitter; STRONG/MEDIUM/WEAK/ORACLE_REQUIRED verdicts. Consumed by mcp-server-sdlc's commutativity_verify MCP tool.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages