🌐 Language: English | Español | Português (BR) | 日本語 | 한국어 | 简体中文 | Русский
Quick Demo · Why · How It Works · Your SDD Layout · Harnesses · User Guide · CLI · Deep-Dives
Deterministic wave scheduler & isolated worktree sandbox for parallel AI coding agents — prevents silent merge-bombs before spending a single LLM token.
sdd-parallelsits between your Spec Kit / BMAD / GSD / OpenSpec / Beads backlog and coding agents (Claude Code, Codex, Antigravity, or any worktree CLI).
https://github.com/user-attachments/assets/76b8c429-3146-43b9-9ba9-89de15f97b13
🎬 Full 1080p Video Explainer — Voiceover in 7 languages via the 🌐 Language switcher above.
Explore hands-on: ⚡ Live Interactive Wave Inspector (zero-install browser demo) · 📘 Operator User Guide & Day-1 Runbook.
⚡ Why Does This Exist? (In Plain English)
With 10–15 specs or stories, teams face two bad choices:
- One agent, sequentially — safe, but 6–8 hours of waiting.
- 3–4 agents in naive
git worktreedirs — fast until merge time:- Type-1 (direct): two agents edit
sprint-status.yaml,STATE.md, orcli.py→<<<<<<<conflicts. - Type-2 (semantic, silent): Agent A changes
normalizer.py's signature; Agent B calls the old one fromapi.py. Git merges cleanly — andmainbreaks. - Scope creep: an agent rewrites shared
schema.pyoutside its task.
- Type-1 (direct): two agents edit
sdd-parallel prevents this before any token is spent: it scans AST + call graphs, packs safe tasks into Waves, isolates agents in reusable slots (track-a/b/c), blocks out-of-scope edits, and merges behind quality gates.
| What Happens | ❌ Sequential | 💥 Naive --worktree |
✅ sdd-parallel |
|---|---|---|---|
| 12-story sprint | ~6–8 h | ~2 h coding + ~2 h fixing merges | ~2.5 h total (2x–3x faster) |
| Hidden API collisions | By going slow | Breaks main ($W_A \cap I_B \neq \emptyset$) |
Prevented upfront (Wave 1 → 2) |
| Shared CLI / routers | Serialized | Git conflict per merge | Concurrent via AST 3-way merge (registry_merger.py + fail-closed Partial Barrier Merge) |
| Status files | Serial updates | Constant <<<<<<< markers |
Monotonic 3-way merge (0 markers) |
| Out-of-scope edits | Prompt warning | Bypassed via bash/sed |
Blocked (PreToolUse + Terminal Guard + chmod a-w) |
| Worktree clutter | None | 15 leftover task-* dirs |
Fixed reusable slots (track-a/b/c) |
Notation: $W$ = modified files (Write set); $I$ = importing/dependent files (Impact radius).
🚀 Try It in 5 Seconds (Zero API Keys, Annotated Walkthrough)
No API key, no LLM subscription, no clone. Run via uv (or pipx run sdd-parallel demo):
uvx sdd-parallel demo --kit all # or single kit: uvx sdd-parallel demo --kit spec-kit
Scaffolds real throwaway Git repos (5 tasks, 6 Python modules), runs AST analysis, tests Scope Guard DENY locks, merges concurrent cli.py edits via 3-way AST merge, and executes a 0-conflict 3-way status merge + live smoke checkpoint gate (run_quality_gates=True, < 5s per kit):
================================================================
5/5 SDD KITS VERIFIED (BMAD, SPEC KIT, GSD, OPENSPEC, BEADS)
================================================================
Kit | Merge-Bomb | Worktrees | Scope Guard | 3-Way Merge
----------------------------------------------------------------
bmad | PASSED | PASSED | PASSED | PASSED
spec-kit | PASSED | PASSED | PASSED | PASSED
gsd | PASSED | PASSED | PASSED | PASSED
openspec | PASSED | PASSED | PASSED | PASSED
beads | PASSED | PASSED | PASSED | PASSED
================================================================
🔍 Click to expand: 4-step walkthrough (--kit spec-kit) & interactive sandbox
[Step 1/4]AST Roles:schema.py→spine(serialize);cli.py→additive_registry(append-only);api.pyimportsnormalizer.py.[Step 2/4]Type-2 Merge-Bomb:T002(normalizer.py) andT004(api.py) both carry[P], yetBSPWaveSchedulerdetects $W(\text{T002}) \cap I(\text{T004}) \neq \emptyset$ and defersT004to Wave 2 whileT002+T003sharecli.pyin Wave 1:
Wave 1: [track-a: T002] [track-b: T003] (normalizer.py + exporter.py + cli.py)
Wave 2: [track-a: T001] [track-b: T004] (after Wave 1 normalizer)
Wave 3: [track-a: T005] (schema barrier)
[Step 3/4]Clean Slots & Scope Guard: Injected boundaries (ACTIVE_TRACK.md,.parallel-lock.json,.tmp/track-context.md) are hidden viainfo/exclude(Clean git status: True);track-atouchingschema.pyreturnsDENY.[Step 4/4]3-Way Merge & Sandbox: Monotonic checkbox merge resolves[ ] < [x]intasks.mdwith 0 markers. Full snapshots in Dossier 07, or run a sandbox:
uvx sdd-parallel demo --kit gsd --scaffold-only --output-dir ./sdd-sandbox
cd sdd-sandbox && sdd-parallel plan && sdd-parallel prepare --wave 1
🗺️ How It Works & Daily 4-Command Workflow
sdd-parallel follows Bulk Synchronous Parallel (BSP): isolated tracks run with zero cross-edits and synchronize at a quality-gate merge barrier.
1. Install once (Python >= 3.11, Git >= 2.30): uv tool install sdd-parallel (or pipx install sdd-parallel; exposes sdd-parallel & parallel-flow).
2. Run a wave:
sdd-parallel plan # 1. Scan specs + AST and build waves
sdd-parallel prepare --wave 1 # 2. Provision slots & inject locks
sdd-parallel run-guide --wave 1 # Print native command per slot
# 3. Run agents in .worktrees/track-a, track-b, ...
sdd-parallel verify-wave --wave 1 # 4. Audit diff vs .parallel-lock.json
sdd-parallel merge --wave 1 # Quality gates & 3-way merge to main
Undo & Inspect: abort-wave --wave 1 · rollback-wave --wave 1 --save-backup (LIFO + safety branch) · inspect --open (assets/inspector.html).
- Mode A — Interactive Assisted:
plan→inspect --open→ copyprepare/mergevia CLI Action Bridge and supervise.worktrees/track-{a,b}. - Mode B — Cyclic Autopilot:
sdd-parallel autopilot --wave 1 --harness {antigravity,claude-code,codex} --execute --policy {single-shot,cyclic} [--max-review-rounds N] [--routing-file FILE].
👉 See docs/USER_GUIDE.md (Wave Inspector & Modes) and Day-1 Recovery Runbook.
📂 See Your Exact SDD Project Layout (Before & After)
Read-only Anti-Corruption Layer (ACL) adapters normalize 5 SDD formats without altering your specs:
| SDD Framework | Read-Only Artifacts (Locked) | Task Discovery | Status Sync |
|---|---|---|---|
Spec Kit (.specify/) |
constitution.md, feature.json, spec.md, plan.md |
specs/*/tasks.md (T001 [P]) |
3-way Markdown |
BMAD (v6.3+/v7) |
epic-*-context.md (Zero Cache Invalidation) |
sprint-status.yaml, epics.md, spec-*.md |
3-way YAML |
GSD (.planning/) |
PROJECT.md, REQUIREMENTS.md, ROADMAP.md, STATE.md |
phases/*/NN-NN-PLAN.md |
Centralized STATE.md |
OpenSpec (openspec/) |
openspec/specs/**, project.md, config.yaml, sibling changes |
openspec/changes/<slug>/tasks.md |
3-way Markdown |
Beads (.beads/) |
.beads/config.yaml |
.beads/*.jsonl (bd-101 + blocks) |
Line-wise 3-way JSONL |
🌱 Example: GitHub Spec Kit (.specify/ & specs/*/tasks.md) — After plan + prepare --wave 1
my-project/
├── .parallel/{artifacts/wave-plan.json, history/, state.json}
├── .specify/… # untouched
├── .worktrees/
│ ├── track-a/ # Wave 1 → T002
│ │ ├── .specify/memory/constitution.md # 🔒 read-only
│ │ ├── specs/001-telemetry/{plan,spec}.md # 🔒 read-only
│ │ ├── specs/001-telemetry/tasks.md # ✍️ writable
│ │ ├── .tmp/track-context.md # 👻 hidden (info/exclude)
│ │ ├── .parallel-lock.json # 👻 hidden (info/exclude)
│ │ └── ACTIVE_TRACK.md # 👻 → /speckit.implement T002
│ └── track-b/ # Wave 1 → T003
└── specs/… & src/… # untouched in main
Legend: 🔒 read-only (chmod a-w + PreToolUse deny) · 👻 hidden (info/exclude) · ✍️ writable scope.
👉 All 5 Before/After trees (Spec Kit, BMAD, GSD, OpenSpec, Beads & Custom SDD): Section 2 of docs/USER_GUIDE.md.
🔌 Fits Right Into Your Existing Stack (Zero Lock-In)
sdd-parallel run-guide --wave 1 prints each slot's native command (mirrored in ACTIVE_TRACK.md):
| SDD Kit | Native command per track |
|---|---|
| GitHub Spec Kit | /speckit.implement T002 |
| BMAD Method | /bmad-build 1-2 |
| GSD | /gsd-execute-phase 01-02 |
| OpenSpec | /openspec-apply normalize-telemetry |
| Beads | bd update bd-102 --status in-progress |
📦 Spec Kit Extension (
extension.yml):specify extension add --from https://github.com/stopActingSoSmall/sdd-parallel/archive/refs/tags/v0.2.2.zip(orspecify extension add sdd-parallel) adds/specify plan-waves,/specify prepare-wave --wave 1,/specify merge-wave --wave 1.
| Harness | How it plugs in |
|---|---|
Claude Code (claude) |
Run claude in .worktrees/track-a (blockWritesOutsideWorkingDirectories + PreToolUse + chmod a-w), or autopilot --wave 1 --harness claude-code. |
Codex CLI (codex) |
codex --cd .worktrees/track-b; chmod a-w locks contracts, verify-wave audits diffs. Autopilot: --harness codex. |
Google Antigravity (agy) |
prepare --wave 1 --antigravity-layout places slots in ~/.gemini/antigravity/worktrees/<Project>/track-a; install-plugin adds the scope-guard hook. |
| Cursor, Windsurf, OpenCode, Kimi, Aider, Cline, Trae | Zero-config .worktrees/track-{a,b,c}, chmod a-w, ACTIVE_TRACK.md, claim-track for external worktrees, and verify-wave. |
👉 Recipes (local .worktrees/ vs --antigravity-layout, claim-track, MCP) in Section 1 of docs/USER_GUIDE.md.
🔍 Architecture, Mathematical Model & Dossier Deep-Dives
- 📘 Operator User Guide & Day-1 Runbook (
docs/USER_GUIDE.md): harness setup, 5 Before/After trees, Wave Inspector, recovery runbook - 📖 01 — Core Product Brief · 02 — Capabilities White Paper · 03 — Integration Spec
- 📊 04 — Competitive Taxonomy · 07 — E2E Demo Walkthrough · Architecture SSOT · Dossier Index · RU Dossier
❓ Hard Engineering Questions & Honest Boundaries (FAQ)
- How does the planner know
write_filesbefore code is written? Three layers of protection: (a) explicit paths declared in specs (Code Map,Files:, GSD XML<files>, backticks) → (b) the Pre-Wave AST Symbol Linker resolving mentioned function/class names to files in $O(1)$ → (c) Dynamic Scope Escalation (.tmp/scope-escalation.json), wherePreToolUselogs denied out-of-scope edits,verify-wavedefers the task to Wave $K+1$ (resetting the emptied slot and updating.parallel/wave-plan.json), andmergeexecutes against the updated plan. - What about TypeScript, Go, Rust, or non-Python repositories?
Honest boundary: the built-in zero-dependency AST scanner (
ast_scanner.py) and 3-way registry merger (registry_merger.py) natively parse Python. For polyglot repositories (TS/JS, Go, Rust, Java),sdd-parallelrelies on explicit spec file lists, the optional Tree-sitter sidecarcode-review-graph(CRGSidecarAdapter),contract_globs,DEPENDENCY_DRIFTlockfile checks, andPartial Barrier Merge(default onmerge) to isolate conflicting tracks safely. - Can an agent bypass
PreToolUsehooks via shell (sed -i,python -c,cp)? Enforcement never relies on a single hook — it is 3-Tier Defense-in-Depth: Tier 1 (PreToolUse+ Terminal Guard inspectingBash/run_command/powershellredirects and inline writes) → Tier 2 (OS-levelchmod a-won Spine and sibling-owned files) → Tier 3 (verify-waveauditing actualgit diff merge-base...HEADand blocking the merge on any violation). - AST cannot see cross-layer contracts (Pydantic JSON → TS frontend, SQL FK, OpenAPI)!
Correct — static import graphs stop at syntax boundaries.
sdd-parallelcloses this gap declaratively viaDEFAULT_CONTRACT_GLOBS(**/schemas/**,**/migrations/**,openapi.*,*.proto,*.graphql) plus project-specificfile_rolesin.parallel-config.json, forcing cross-layer contracts into strictSPINEserialization.
🏛️ Internal Engine Architecture & 9 Core Invariants
flowchart TD
Inputs["1. SDD Adapters\n(BMAD, Spec Kit, GSD, OpenSpec, Beads)"] --> Engine["2. AST + CRG + BSPWaveScheduler\n(SPINE / ADDITIVE_REGISTRY / Kahn DAG)"]
Engine --> Actuation["3. Fixed Slots (track-a/b/c)\n(3-Tier Scope Guard + verify-wave)"]
Actuation --> Barrier["4. merge-wave\n(3-Way Status Merger)"]
Barrier -. Error / Revert .-> Rollback["LIFO Rollback\n(abort-wave / rollback-wave)"]
- Zero Worktree Pollution: boundaries masked via
info/exclude;git status --porcelainstays empty. - Zero Cache Invalidation: pre-compiled contexts stay read-only; state lives in
.parallel/. - 100% Coverage & Acyclicity: Kahn check ensures zero dropped tasks and zero cycles.
- Blast-Radius Isolation: disjoint writes ($W_A \cap W_B = \emptyset$) and semantic impact ($W_A \cap I_B = \emptyset$).
- Universal Anti-Overfitting:
SPINE,ADDITIVE_REGISTRY,STANDARDderive from AST + centrality. - Fixed Slots:
track-a/b/creset in place (git checkout -B+git clean -fd). - Three-Tier Guard:
PreToolUse+ Terminal Guard (Bash,run_command) + OSchmod a-w. - Monotonic Status Lattice: $\texttt{backlog}(0) < \dots < \texttt{done}(4)$ with 0 markers.
- LIFO Rollbacks: reverse-order revert with
backup/wave-<K>-before-rollback-*branches.
🛠️ Full CLI Reference
Click to expand: all 16 subcommands & flags
Shared flags: --repo REPO, --max-tracks N, --kit KIT, --routing-file FILE, --dry-run, --dynamic-worktrees.
| Command | Specific Flags & Purpose |
|---|---|
sdd-parallel demo |
[--kit {...,all}] [--keep-temp] [--scaffold-only] [--output-dir DIR] — Offline demo / sandbox. |
sdd-parallel plan |
[--include-done] [--plan-source {auto,plan,specs}] [--output-dir DIR] — Build wave-plan.json. |
sdd-parallel prepare --wave K |
[--headless] [--antigravity-layout] — Provision slots, OS locks, boundaries. |
sdd-parallel claim-track --wave K |
--track <id> --worktree <path> [--headless] — Lock an existing worktree. |
sdd-parallel run-guide --wave K |
[--antigravity-layout] — Print native launch command per slot. |
sdd-parallel verify-wave --wave K |
[--defer-ast-violations] — Audit slots vs .parallel-lock.json, merge-base diff, pre-merge ast_diff_gate, and scope escalations. |
sdd-parallel merge --wave K |
[--skip-gates] [--strict-gates] [--partial-merge|--no-partial-merge] [--cleanup] — Gates, AST/status 3-way merge, default partial commit with culprit bisection (or atomic rollback with --no-partial-merge). |
sdd-parallel abort-wave --wave K |
Reset fixed slots in place to HEAD (or delete branches in --dynamic-worktrees). |
sdd-parallel rollback-wave --wave K |
[--to-commit COMMIT] [--save-backup|--no-backup] — LIFO revert + safety branch + status reset. |
sdd-parallel merge-status |
--base B --ours O --theirs T --out OUT — 3-way merge for sprint-status.yaml. |
sdd-parallel check-lock |
--file PATH [--tool TOOL] — Check write against active lock manifest. |
sdd-parallel install-plugin |
[--target-dir DIR] — Install portable Antigravity plugin. |
sdd-parallel init-custom |
[--specs-dir DIR] [--format {markdown,yaml}] [--test-cmd CMD] [--non-interactive] — Initialize .parallel/custom-kit.yaml. |
sdd-parallel autopilot --wave K |
[--harness {antigravity,claude-code,codex}] [--antigravity-layout] [--execute] [--policy {single-shot,cyclic}] [--max-review-rounds N] — Spawn tracks. |
sdd-parallel bench |
[--since REV] [--until REV] [--demo] [--format {text,json}] [--output-file FILE] — Merge-Bomb backtest vs static model. |
sdd-parallel inspect |
[--plan PATH] [--output PATH] [--open] — Open HTML Wave Inspector. |
🚢 Release Matrix: Shipped (v0.2.2) vs Roadmap (v0.3+)
✅ Shipped in v0.1.0 – v0.2.2
- BSP wave scheduler (Kahn acyclicity) + AST hotspot scanner +
code-review-graph v2.3.9sidecar + Spine Bucket Locks (Class C) &NAMESPACE_COLLISION(Class D). - Pre-merge
ast_diff_gate.py: virtual Tarjan import cycles (Class G), signature/default drift (Classes A/B), AST-shingle duplicate helpers (Class F), lockfile collisions (Class H). - Partial Barrier Merge (default in CLI
merge,--no-partial-mergefor atomic rollback), OCC centrality ordering, deterministic culprit bisection,.parallel/barrier-feedback-<story_id>.jsonNACK injection, and DAG tail re-scheduling (reschedule_remaining_waves). - Python AST-aware 3-way
ADDITIVE_REGISTRYmerger (registry_merger.py, fail-closed fallback) + intra-file AST function isolation (are_functions_isolated) and receiver-hinted router decorators. - Fixed slots (
track-a/b/c) with in-place reset,info/excludemasking,.venv/node_modulesNTFS Junctions (Windows, no admin) / POSIX symlinks. - 3-tier Scope Guard (
PreToolUse+ Terminal Guard +chmod a-w), symbol linker,.tmp/scope-escalation.json. - Monotonic 3-way status merger (YAML, Markdown,
STATE.md, JSONL) + LIFO transactional rollback. - 5 SDD adapters (Spec Kit +
extension.yml, BMAD +mattpocock/skills+bmad-loop, GSD, OpenSpec, Beads). - Offline
demo --kit all,bench8-class backtest (A–H, 0 FN), HTML Wave Inspector (inspect --open),--scaffold-only. - Multi-window & Depth-0 autopilot (
agy, Claude Code, Codex) with--routing-file,TaskStructuralSignals,--policy cyclic(ADR-0009). - Clean-clone CI (Ubuntu/macOS/Windows, Python 3.11–3.13) & PyPI Trusted Publishing.
🚧 Planned for v0.3+
- Strict Kit Auto-Detection (zero silent fallback, TTY disambiguation)
- System-1 Intent Extractor (
TaskIntentVector) & Decision-1 Pairwise Collision Classifier - Native Polyglot Tree-sitter AST & Auto-CRG indexing (TS/JS, Go, Rust)
- Adaptive
--max-tracks auto& Antigravity/swarmbrief exporter (--format swarm-brief)
🤝 Contact & Collaborations
- Research, Grants & Private Inquiries: sdd-parallel@metrichub.dev
- Architecture Q&A & Community: GitHub Discussions
- Security Disclosures: See SECURITY.md
🛠️ Contributing, Local Development & Security
git clone https://github.com/stopActingSoSmall/sdd-parallel.git && cd sdd-parallel && uv sync
uv run pytest && uv run mypy --strict src/sdd_parallel && uv run ruff check src/ tests/ scripts/
uv run sdd-parallel demo --kit all
- Contributing: Contributing Guide · Security: Security Policy · License: MIT (Voiceover powered by ElevenLabs and Google Gemini).
💼 Commercial Audits & Enterprise Monorepo Support
Fixed-scope B2B audits (Parallel SDD Readiness & Blast-Radius Audit, $500–$2,500): sdd-parallel bench retrospective, custom .parallel-config.json (contract_globs, spine serialization, quality gates), and HTML Wave Inspector reports via GitHub Discussions.
Metadata
Release files for sdd-parallel 0.2.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sdd_parallel-0.2.3.tar.gz | 294.1 kB | With provenance | Details for sdd_parallel-0.2.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sdd_parallel-0.2.3-py3-none-any.whl | Python 3 | none | any | Details for sdd_parallel-0.2.3-py3-none-any.whl |
Total release size: 494.3 kB
Release files / sdd_parallel-0.2.3.tar.gz
| Download URL | sdd_parallel-0.2.3.tar.gz |
|---|---|
| Size | 294.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
55770d527cc239054d47149afdc22091f1da5daf4f17b1df5b6295bcca13312e
|
|
BLAKE2b-256 checksum How to use checksums |
c68222c62f3b1e7a0ebd28361b03fb4d693e8d5f58b21f8e91bde4c95ada9550
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.
Transparency logRelease files / sdd_parallel-0.2.3-py3-none-any.whl
| Download URL | sdd_parallel-0.2.3-py3-none-any.whl |
|---|---|
| Size | 200.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
809939f69c76872afdffb265bc2103e946e7b97b6f11f411439468ee5646c564
|
|
BLAKE2b-256 checksum How to use checksums |
3c6eebb23d6802179ddea60c9f2fdd8be0f90c53328d480a487815260c3ef209
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.
Transparency logSecurity for sdd-parallel 0.2.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for sdd_parallel-0.2.3.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.