sdd-parallel 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- sdd_parallel-0.1.0/CHANGELOG.md +24 -0
- sdd_parallel-0.1.0/LICENSE +21 -0
- sdd_parallel-0.1.0/PKG-INFO +320 -0
- sdd_parallel-0.1.0/README.md +291 -0
- sdd_parallel-0.1.0/pyproject.toml +97 -0
- sdd_parallel-0.1.0/pyproject.toml.orig +91 -0
- sdd_parallel-0.1.0/src/sdd_parallel/__init__.py +28 -0
- sdd_parallel-0.1.0/src/sdd_parallel/adapters/__init__.py +168 -0
- sdd_parallel-0.1.0/src/sdd_parallel/adapters/beads.py +324 -0
- sdd_parallel-0.1.0/src/sdd_parallel/adapters/bmad.py +637 -0
- sdd_parallel-0.1.0/src/sdd_parallel/adapters/gsd_hijack.py +403 -0
- sdd_parallel-0.1.0/src/sdd_parallel/adapters/openspec.py +419 -0
- sdd_parallel-0.1.0/src/sdd_parallel/adapters/spec_kit.py +483 -0
- sdd_parallel-0.1.0/src/sdd_parallel/ast_scanner.py +209 -0
- sdd_parallel-0.1.0/src/sdd_parallel/autopilot.py +167 -0
- sdd_parallel-0.1.0/src/sdd_parallel/cli.py +740 -0
- sdd_parallel-0.1.0/src/sdd_parallel/crg_sidecar.py +137 -0
- sdd_parallel-0.1.0/src/sdd_parallel/demo.py +897 -0
- sdd_parallel-0.1.0/src/sdd_parallel/hooks/__init__.py +12 -0
- sdd_parallel-0.1.0/src/sdd_parallel/hooks/blast_radius_guard.py +339 -0
- sdd_parallel-0.1.0/src/sdd_parallel/models.py +230 -0
- sdd_parallel-0.1.0/src/sdd_parallel/plugin_installer.py +162 -0
- sdd_parallel-0.1.0/src/sdd_parallel/py.typed +0 -0
- sdd_parallel-0.1.0/src/sdd_parallel/resources/SKILL.md +130 -0
- sdd_parallel-0.1.0/src/sdd_parallel/resources/__init__.py +1 -0
- sdd_parallel-0.1.0/src/sdd_parallel/scheduler.py +378 -0
- sdd_parallel-0.1.0/src/sdd_parallel/status_merger.py +284 -0
- sdd_parallel-0.1.0/src/sdd_parallel/worktree.py +1346 -0
- sdd_parallel-0.1.0/tests/test_architecture_invariants.py +438 -0
- sdd_parallel-0.1.0/tests/test_blast_radius_guard.py +354 -0
- sdd_parallel-0.1.0/tests/test_bmad_preflight_and_worktree.py +640 -0
- sdd_parallel-0.1.0/tests/test_cli.py +135 -0
- sdd_parallel-0.1.0/tests/test_demo_e2e.py +107 -0
- sdd_parallel-0.1.0/tests/test_drift_remediation.py +206 -0
- sdd_parallel-0.1.0/tests/test_multi_sdd_adapters.py +1033 -0
- sdd_parallel-0.1.0/tests/test_plugin_and_autopilot.py +137 -0
- sdd_parallel-0.1.0/tests/test_rollback.py +279 -0
- sdd_parallel-0.1.0/tests/test_scheduler_and_merger.py +932 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
## [0.1.0] - 2026-10-29
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
- **BSP Wave Scheduler (`sdd-parallel plan`):** Bulk-Synchronous Parallelism engine with Kahn's topological sorting, cyclic dependency detection, and guaranteed 100% task coverage.
|
|
14
|
+
- **AST Hotspot & CRG Blast Radius Scanner:** Static Python import graph analysis and `code-review-graph` sidecar integration catching Type 2 semantic collisions ($W_A \cap I_B \neq \emptyset$) with sub-second performance.
|
|
15
|
+
- **Fixed Track Slots (`track-<id>`):** Parametric fixed-slot worktree pool (`track-a`, `track-b`, ...) with $O(1)$ disk footprint and in-place `git checkout -B` reset without worktree teardown.
|
|
16
|
+
- **Defense-in-Depth Scope Guard:** Multi-layered agent isolation combining `PreToolUse` hook, Terminal Guard for bash/powershell/cmd, OS-level read-only file locks (`chmod a-w`), and merge-base git diff audits.
|
|
17
|
+
- **Monotonic 3-Way YAML Merger:** Semilattice-based 3-way merger for `sprint-status.yaml` preserving comments and structure with zero conflict markers (`<<<<<<<`).
|
|
18
|
+
- **LIFO Transactional Rollback (`sdd-parallel rollback-wave` / `abort-wave`):** Strict LIFO wave unwind with immutable safety backup branches (`backup/wave-<K>-before-rollback-*`) and polymorphic task status reset.
|
|
19
|
+
- **Multi-Kit SDD Adapters:** Out-of-the-box support for 5 major agent ecosystems: BMAD Method, GitHub Spec Kit, GSD Hijack, OpenSpec, and Beads.
|
|
20
|
+
- **Standalone Merge-Bomb Demo (`sdd-parallel demo`):** Self-contained, zero-API-key demonstration of Type 2 conflict detection and 3-way resolution running in <5 seconds.
|
|
21
|
+
- **CI / CD Automation:** GitHub Actions workflow testing on Ubuntu, Windows, and macOS across Python 3.11, 3.12, and 3.13 with automated packaging and PyPI Trusted Publishing.
|
|
22
|
+
|
|
23
|
+
[Unreleased]: https://github.com/stopActingSoSmall/sdd-parallel/compare/v0.1.0...HEAD
|
|
24
|
+
[0.1.0]: https://github.com/stopActingSoSmall/sdd-parallel/releases/tag/v0.1.0
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 stopActingSoSmall
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: sdd-parallel
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: SDD-agnostic multi-track parallel roadmap orchestrator, AST/CRG blast-radius solver, and Git worktree manager for AI coding agents
|
|
5
|
+
Keywords: ai-agents,sdd,bmad,spec-kit,gsd,openspec,beads,parallel-orchestration,merge-bomb,git-worktree,parallel-execution,ast,blast-radius
|
|
6
|
+
Author: stopActingSoSmall
|
|
7
|
+
Author-email: stopActingSoSmall <stopActingSoSmall@users.noreply.github.com>
|
|
8
|
+
License-Expression: MIT
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Classifier: Development Status :: 4 - Beta
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
16
|
+
Classifier: Topic :: Software Development :: Build Tools
|
|
17
|
+
Classifier: Topic :: Software Development :: Version Control :: Git
|
|
18
|
+
Classifier: Typing :: Typed
|
|
19
|
+
Requires-Dist: ruamel-yaml>=0.19.1
|
|
20
|
+
Requires-Dist: code-review-graph>=2.3.9,<3.0.0 ; extra == 'crg'
|
|
21
|
+
Requires-Python: >=3.11
|
|
22
|
+
Project-URL: Homepage, https://github.com/stopActingSoSmall/sdd-parallel
|
|
23
|
+
Project-URL: Repository, https://github.com/stopActingSoSmall/sdd-parallel
|
|
24
|
+
Project-URL: Issues, https://github.com/stopActingSoSmall/sdd-parallel/issues
|
|
25
|
+
Project-URL: Changelog, https://github.com/stopActingSoSmall/sdd-parallel/blob/master/CHANGELOG.md
|
|
26
|
+
Project-URL: Documentation, https://github.com/stopActingSoSmall/sdd-parallel/tree/master/docs/dossier
|
|
27
|
+
Provides-Extra: crg
|
|
28
|
+
Description-Content-Type: text/markdown
|
|
29
|
+
|
|
30
|
+
# โก SDD-Parallel
|
|
31
|
+
|
|
32
|
+
[](https://github.com/stopActingSoSmall/sdd-parallel/actions/workflows/ci.yml)
|
|
33
|
+
[](https://www.python.org/)
|
|
34
|
+
[](LICENSE)
|
|
35
|
+
[](#-5-second-offline-demo-zero-api-keys)
|
|
36
|
+
|
|
37
|
+
<p align="center">
|
|
38
|
+
<b>๐ Language:</b>
|
|
39
|
+
<b>English</b> |
|
|
40
|
+
<a href="docs/i18n/zh-CN/README.md">็ฎไฝไธญๆ</a> |
|
|
41
|
+
<a href="docs/i18n/es/README.md">Espaรฑol</a> |
|
|
42
|
+
<a href="docs/i18n/pt-BR/README.md">Portuguรชs (BR)</a> |
|
|
43
|
+
<a href="docs/i18n/ja/README.md">ๆฅๆฌ่ช</a> |
|
|
44
|
+
<a href="docs/i18n/ko/README.md">ํ๊ตญ์ด</a> |
|
|
45
|
+
<a href="docs/i18n/ru/README.md">ะ ัััะบะธะน</a>
|
|
46
|
+
</p>
|
|
47
|
+
|
|
48
|
+
> **Spec-Driven Concurrency & Blast-Radius Governance Harness for AI Coding Agents**
|
|
49
|
+
> (Google Antigravity, Claude Code, OpenAI Codex)
|
|
50
|
+
> *Available as the `sdd-parallel` CLI and the convenient `parallel-flow` alias.*
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## ๐ฏ The Problem
|
|
55
|
+
|
|
56
|
+
Modern Spec-Driven Development (SDD) harnessesโ**BMAD Method (v6/v7)**, **GitHub Spec Kit (`.specify/`)**, **GSD (Get Shit Done)**, **OpenSpec**, and **Beads**โexcel at decomposing requirements into verifiable single-task specifications. However, they suffer from a **fatal architectural limitation when scaling to parallel execution**:
|
|
57
|
+
|
|
58
|
+
1. **Linear Story Queues:** Schedulers enforce strictly serial execution (`Story 1 -> Story 2 -> Story 3`), ignoring independent epics.
|
|
59
|
+
2. **Merge-Bombs in Shared Configs:** Concurrent agents collide on shared registries and sprint status files (`sprint-status.yaml`, `STATE.md`, `tasks.md`).
|
|
60
|
+
3. **Type-2 Semantic Collisions ($W_A \cap I_B \neq \emptyset$):** Agent A refactors a shared interface, while concurrent Agent B calls the previous signature. Local git branches pass tests in isolation, but fail catastrophically upon merging.
|
|
61
|
+
4. **Subagent Depth Limits:** Complex multi-agent workflows (like BMAD's 3 review lenses) break when nested inside flat subagents (`Max Subagent Depth = 1`).
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## ๐ก The Solution: `sdd-parallel`
|
|
66
|
+
|
|
67
|
+
`sdd-parallel` is a deterministic orchestration and safety harness that:
|
|
68
|
+
- **Analyzes SDD Roadmaps Polymorphically:** Zero hardcoding; extracts tasks, dependencies, and code maps across 5 SDD frameworks.
|
|
69
|
+
- **Solves Semantic Blast Radius (AST + Call Graph):** Calculates directed dependencies, Spine Locks, and Type-2 impact overlaps ($W_A \cap I_B$).
|
|
70
|
+
- **Provisions Fixed Track Slots (`track-a`, `track-b`, ...):** Allocates permanent worktree slots with in-place reset (`git checkout -B` + `git clean -fd`), preserving an $O(1)$ disk footprint.
|
|
71
|
+
- **Enforces a Three-Tier Scope Guard:** Intercepts out-of-scope edits via `PreToolUse` hooks, blocks shell escapes in `Bash`/PowerShell, and locks sensitive files via OS `chmod a-w`.
|
|
72
|
+
- **Performs Monotonic 3-Way Merges:** Reconciles sprint statuses via monotonic lattice resolution ($\max(\text{rank})$) with zero `<<<<<<<` conflict markers.
|
|
73
|
+
- **Guarantees LIFO Transactional Rollbacks:** Safely reverses merged waves with automated backup branches and polymorphic SDD task status resets.
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## ๐ 5-Second Offline Demo (Zero API Keys)
|
|
78
|
+
|
|
79
|
+
Clone the repository and run the standalone verification demo offline:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
uv run sdd-parallel demo
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
```text
|
|
86
|
+
============================================================================
|
|
87
|
+
SDD-PARALLEL STANDALONE MERGE-BOMB DEMO (ZERO API KEYS / OFFLINE)
|
|
88
|
+
============================================================================
|
|
89
|
+
Workspace: /tmp/sdd-parallel-demo-xyz
|
|
90
|
+
|
|
91
|
+
[Step 1/4] AST & Architectural Role Classification
|
|
92
|
+
----------------------------------------------------------------------------
|
|
93
|
+
File Path | Detected Role | Importers
|
|
94
|
+
----------------------------------------------------------------------------
|
|
95
|
+
src/demo_app/__init__.py | additive_registry | -
|
|
96
|
+
src/demo_app/api.py | standard | -
|
|
97
|
+
src/demo_app/cli.py | additive_registry | -
|
|
98
|
+
src/demo_app/exporter.py | standard | -
|
|
99
|
+
src/demo_app/normalizer.py | standard | src/demo_app/api.py
|
|
100
|
+
src/demo_app/schema.py | spine | -
|
|
101
|
+
|
|
102
|
+
[Step 2/4] Type-2 Semantic Merge-Bomb Detection & BSP Wave Schedule
|
|
103
|
+
----------------------------------------------------------------------------
|
|
104
|
+
Collision Analysis:
|
|
105
|
+
- Naive Scheduler : W(1-2)={normalizer.py, cli.py} vs W(2-1)={api.py}
|
|
106
|
+
-> DISJOINT WRITES (False Safe!)
|
|
107
|
+
- BSPWaveScheduler: Detected semantic_collision between '1-2' and '2-1'
|
|
108
|
+
-> Overlap W(1-2) ^ I(2-1) on: src/demo_app/api.py
|
|
109
|
+
- Additive Registry: Tasks '1-2' and '1-3' both touch 'src/demo_app/cli.py'
|
|
110
|
+
-> Role: ADDITIVE_REGISTRY (Parallel allowed in Wave 1)
|
|
111
|
+
|
|
112
|
+
Wave Schedule:
|
|
113
|
+
* Wave 1
|
|
114
|
+
- track-a: Story 1-2 -> writes: src/demo_app/normalizer.py (+ shared: src/demo_app/cli.py)
|
|
115
|
+
- track-b: Story 1-3 -> writes: src/demo_app/exporter.py (+ shared: src/demo_app/cli.py)
|
|
116
|
+
* Wave 2
|
|
117
|
+
- track-a: Story 1-1 -> writes: src/demo_app/schema.py
|
|
118
|
+
- track-b: Story 2-1 -> writes: src/demo_app/api.py
|
|
119
|
+
* Wave 3
|
|
120
|
+
- track-a: Story 2-2 -> writes: src/demo_app/schema.py
|
|
121
|
+
|
|
122
|
+
[Step 3/4] Fixed-Slot Worktree Provisioning & PreToolUse Scope Guard
|
|
123
|
+
----------------------------------------------------------------------------
|
|
124
|
+
Provisioned Fixed Slots (100% Clean git status: True):
|
|
125
|
+
- track-a (.worktrees/track-a)
|
|
126
|
+
- track-b (.worktrees/track-b)
|
|
127
|
+
|
|
128
|
+
PreToolUse Scope Guard Check (track-a -> 'src/demo_app/schema.py'):
|
|
129
|
+
- Decision : DENY
|
|
130
|
+
- Violation: File 'src/demo_app/schema.py' cannot be modified by Wave 1 / track-a (stories ['1-2'])
|
|
131
|
+
- Reason : Locked by Spine Chain invariant.
|
|
132
|
+
|
|
133
|
+
[Step 4/4] Barrier Checkpoint & Monotonic 3-Way YAML Merge
|
|
134
|
+
----------------------------------------------------------------------------
|
|
135
|
+
Merged Branches:
|
|
136
|
+
- parallel/track-a
|
|
137
|
+
- parallel/track-b
|
|
138
|
+
|
|
139
|
+
Resolved sprint-status.yaml (0 conflict markers):
|
|
140
|
+
- 1-2-normalize-telemetry-payload: done
|
|
141
|
+
- 1-3-cli-batch-export: done
|
|
142
|
+
============================================================================
|
|
143
|
+
ALL 5 CORE INVARIANTS VERIFIED IN 3.21s
|
|
144
|
+
============================================================================
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
> ๐ **Step-by-Step Demo Anatomy, Graph Theory & Interactive Sandbox Quest:**
|
|
148
|
+
> Want to see frame-by-frame disk snapshots (`Before -> Wave Planning -> Slot Locking -> 3-Way Merge`), understand the graph theory behind `SPINE` / `ADDITIVE_REGISTRY` / `STANDARD` (3-pass `ASTHotspotScanner`), and hands-on test `plan`, `prepare`, `check-lock`, `abort-wave`, and `rollback-wave` inside a live `--keep-temp` sandbox or greenfield repository?
|
|
149
|
+
> ๐ Read the algorithmic foundation in **[System Capabilities & Architectural White Paper](docs/dossier/02_SYSTEM_CAPABILITIES_WHITE_PAPER.md)** and walk through the **[Standalone Demo & Interactive E2E Walkthrough Guide](docs/dossier/07_STANDALONE_DEMO_AND_E2E_WALKTHROUGH.md)** *(part of the canonical **[Architecture & Strategy Dossier](docs/dossier/README.md)**; Russian original in **[docs/i18n/ru/dossier/](docs/i18n/ru/dossier/)**).
|
|
150
|
+
> ๐๏ธ For executive decision-makers and architects: **[Product Brief & Executive Summary](docs/dossier/01_CORE_PRODUCT_BRIEF.md)** | **[System Architecture SSOT](ARCHITECTURE.md)**.
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
## ๐ฆ Requirements & Installation
|
|
155
|
+
|
|
156
|
+
### Prerequisites
|
|
157
|
+
- **Python:** `>= 3.11` (Python 3.11, 3.12, 3.13)
|
|
158
|
+
- **Git:** `>= 2.30` (required for modern `git worktree` isolation and `info/exclude` masking)
|
|
159
|
+
- **Package Manager:** [`uv`](https://docs.astral.sh/uv/) (recommended) or `pipx`
|
|
160
|
+
|
|
161
|
+
### Installation
|
|
162
|
+
|
|
163
|
+
#### As an isolated CLI tool (Recommended)
|
|
164
|
+
```bash
|
|
165
|
+
# Using uv (fastest)
|
|
166
|
+
uv tool install sdd-parallel
|
|
167
|
+
|
|
168
|
+
# Or using pipx
|
|
169
|
+
pipx install sdd-parallel
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
#### From source for local development
|
|
173
|
+
```bash
|
|
174
|
+
git clone https://github.com/stopActingSoSmall/sdd-parallel.git
|
|
175
|
+
cd sdd-parallel
|
|
176
|
+
uv sync
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
After installation, the CLI is available globally via `sdd-parallel` (or short alias `parallel-flow`).
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
## ๐๏ธ System Architecture
|
|
184
|
+
|
|
185
|
+
```mermaid
|
|
186
|
+
flowchart TD
|
|
187
|
+
subgraph Inputs["1. Multi-SDD Roadmap Adapters"]
|
|
188
|
+
BMAD["BMAD Method (v6/v7)"]
|
|
189
|
+
SpecKit["GitHub Spec Kit (.specify/)"]
|
|
190
|
+
GSD["GSD Artifact Hijack (.planning/)"]
|
|
191
|
+
OpenSpec["OpenSpec (openspec/changes/)"]
|
|
192
|
+
Beads["Beads (.beads/issues.jsonl)"]
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
subgraph Engine["2. Hybrid DAG & Blast-Radius Engine"]
|
|
196
|
+
AST["Universal AST Classifier\n(SPINE, ADDITIVE_REGISTRY, STANDARD)"]
|
|
197
|
+
CRG["CRGSidecarAdapter\n(code-review-graph v2.3.9 WAL)"]
|
|
198
|
+
BSP["Deterministic BSPWaveScheduler\n(K-Track Waves, Kahn Acyclicity)"]
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
subgraph Actuation["3. Actuation & Scope Guard"]
|
|
202
|
+
Slots["Fixed Track Slots (track-a/b/c)\n(In-Place Reset, core.fileMode false)"]
|
|
203
|
+
Guard["Three-Tier Scope Guard\n(PreToolUse + Terminal Guard + chmod a-w)"]
|
|
204
|
+
Verify["verify-wave Gate\n(git diff merge-base...HEAD audit)"]
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
subgraph Barrier["4. Barrier Checkpoint & Rollback"]
|
|
208
|
+
Merge["merge-wave Checkpoint\n(3-Way Monotonic YAML Merger)"]
|
|
209
|
+
Rollback["LIFO Rollback Engine\n(abort-wave / rollback-wave --save-backup)"]
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
Inputs --> AST & CRG
|
|
213
|
+
AST & CRG --> BSP
|
|
214
|
+
BSP --> Slots
|
|
215
|
+
Slots --> Guard --> Verify
|
|
216
|
+
Verify --> Merge
|
|
217
|
+
Merge -. Error / Revert .-> Rollback
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
---
|
|
221
|
+
|
|
222
|
+
## ๐ก๏ธ Core Invariants
|
|
223
|
+
|
|
224
|
+
1. **Zero Worktree Pollution:** Injected boundaries (`.tmp/track-context.md`, `.parallel-lock.json`, `ACTIVE_TRACK.md`) are masked via git `info/exclude`. `git status --porcelain` is always 100% clean.
|
|
225
|
+
2. **Zero Cache Invalidation:** Epics contexts in `_bmad-output/planning-artifacts/` are read-only; planner state writes to `_bmad-output/parallel-artifacts/`.
|
|
226
|
+
3. **100% Task Coverage & Acyclic Invariant:** Kahn/Tarjan topological verification guarantees zero lost stories and zero dependency cycles.
|
|
227
|
+
4. **Blast-Radius Enforcement (Type-1 & Type-2):** Disjoint writes ($W_A \cap W_B = \emptyset$) plus disjoint semantic impacts ($W_A \cap I_B = \emptyset$).
|
|
228
|
+
5. **Universal Anti-Overfitting (Invariant 7):** Zero domain-specific path or entity hardcoding in the core engine. Classifies `SPINE`, `ADDITIVE_REGISTRY`, and `STANDARD` strictly through AST heuristics and graph centrality.
|
|
229
|
+
6. **Fixed Track Slots ($O(1)$ Footprint):** Reuses slots `track-a`, `track-b`, `track-c` via `git checkout -B` and `git clean -fd` to prevent UI folder clutter.
|
|
230
|
+
7. **Three-Tier Defense-in-Depth Guard:** `PreToolUse` hook + Terminal command interception (`Bash`, `run_command`) + OS `chmod a-w` file protection.
|
|
231
|
+
8. **Monotonic Status Semi-Lattice:** Statuses resolve monotonically: $\texttt{backlog} (0) < \dots < \texttt{done} (4)$ without merge markers.
|
|
232
|
+
9. **LIFO Transactional Rollbacks:** Reverts merged waves strictly in reverse order with automated safety backup branches (`backup/wave-<K>-before-rollback-*`).
|
|
233
|
+
|
|
234
|
+
---
|
|
235
|
+
|
|
236
|
+
## ๐ ๏ธ CLI Reference
|
|
237
|
+
|
|
238
|
+
| Command | Purpose |
|
|
239
|
+
| :--- | :--- |
|
|
240
|
+
| `sdd-parallel demo [--kit {bmad,spec-kit,gsd,openspec,beads,all}] [--keep-temp] [--scaffold-only] [--output-dir DIR]` | Run the standalone offline Merge-Bomb demo or scaffold an interactive sandbox across 5 SDD kits. |
|
|
241
|
+
| `sdd-parallel plan [--repo REPO] [--max-tracks N] [--kit auto] [--include-done] [--dry-run] [--plan-source {auto,plan,specs}] [--output-dir DIR]` | Analyze roadmap and codebase graph; generate `execution-plan-parallel.md` and `wave-plan.json`. |
|
|
242
|
+
| `sdd-parallel prepare --wave K [--repo REPO] [--max-tracks N] [--kit KIT] [--headless] [--antigravity-layout] [--dynamic-worktrees] [--dry-run]` | Provision worktree slots (`track-a`, `track-b`), configure OS locks, and inject boundaries. |
|
|
243
|
+
| `sdd-parallel claim-track --wave K --track <id> --worktree <path> [--repo REPO] [--max-tracks N] [--kit KIT] [--headless]` | Attach boundary locks to an existing external worktree slot. |
|
|
244
|
+
| `sdd-parallel run-guide --wave K [--repo REPO] [--max-tracks N] [--kit KIT] [--antigravity-layout]` | Display interactive operator run-guide matrix with launch commands for each active track window. |
|
|
245
|
+
| `sdd-parallel verify-wave --wave K [--repo REPO] [--max-tracks N] [--kit KIT] [--dynamic-worktrees]` | Audit worktrees against `.parallel-lock.json` and multi-commit diff against `merge-base`. |
|
|
246
|
+
| `sdd-parallel merge --wave K [--repo REPO] [--max-tracks N] [--kit KIT] [--dynamic-worktrees] [--skip-gates] [--strict-gates] [--cleanup] [--dry-run]` | Barrier checkpoint merge: 3-way status merge, git merge, polymorphic quality gates, and transactional auto-rollback. |
|
|
247
|
+
| `sdd-parallel abort-wave --wave K [--repo REPO] [--dynamic-worktrees]` | Abort unmerged wave: reset slots and remove temporary parallel branches. |
|
|
248
|
+
| `sdd-parallel rollback-wave --wave K [--repo REPO] [--dynamic-worktrees] [--to-commit COMMIT] [--save-backup] [--no-backup] [--kit KIT]` | Revert merged wave in LIFO order with safety backup branch and SDD task status reset. |
|
|
249
|
+
| `sdd-parallel merge-status --base B --ours O --theirs T --out OUT` | Low-level 3-way deterministic merge tool for `sprint-status.yaml`. |
|
|
250
|
+
| `sdd-parallel check-lock --file PATH [--tool TOOL]` | Validate file write permissions against active worktree lock manifest. |
|
|
251
|
+
| `sdd-parallel install-plugin [--target-dir DIR]` | Package and install the portable Antigravity plugin. |
|
|
252
|
+
| `sdd-parallel autopilot --wave K [--repo REPO] [--max-tracks N] [--kit KIT] [--harness <tool>] [--antigravity-layout] [--execute]` | Generate or execute Multi-Conversation Autopilot launch commands with Model Effort Routing. |
|
|
253
|
+
|
|
254
|
+
---
|
|
255
|
+
|
|
256
|
+
## ๐งฉ Supported SDD Kits
|
|
257
|
+
|
|
258
|
+
| SDD Framework | Status | Read-Only Artifacts Detected | Task State Synchronization |
|
|
259
|
+
| :--- | :---: | :--- | :--- |
|
|
260
|
+
| **BMAD Method (`v6.3+` / `v7`)** | โ
Shipped | `sprint-status.yaml`, `epics.md`, `epic-*-context.md`, `spec-*.md` | Monotonic 3-way YAML merge |
|
|
261
|
+
| **GitHub Spec Kit (`.specify/`)** | โ
Shipped | `.specify/specs/*/tasks.md`, `constitution.md` | Markdown status checkboxes |
|
|
262
|
+
| **GSD (Get Shit Done)** | โ
Shipped | `.planning/phases/*-PLAN.md`, `ROADMAP.md` | Artifact Hijack (`STATE.md` central update) |
|
|
263
|
+
| **OpenSpec (`openspec/`)** | โ
Shipped | `openspec/changes/<id>/tasks.md` | Spec-driven task state tracking |
|
|
264
|
+
| **Beads (`.beads/`)** | โ
Shipped | `.beads/issues.jsonl` | Topological issue state updates |
|
|
265
|
+
|
|
266
|
+
---
|
|
267
|
+
|
|
268
|
+
## ๐ข Release Matrix: Shipped (`v0.1.0`) vs Roadmap (`v0.2+`)
|
|
269
|
+
|
|
270
|
+
### โ
Shipped in `v0.1.0` (Production Hardened)
|
|
271
|
+
- Deterministic Bulk-Synchronous Parallel (BSP) wave scheduler with Kahn acyclicity.
|
|
272
|
+
- AST Hotspot Scanner & `code-review-graph v2.3.9` sidecar integration.
|
|
273
|
+
- Fixed Track Slots architecture (`track-a`, `track-b`, `track-c`) with in-place reset.
|
|
274
|
+
- Three-Tier Defense-in-Depth Scope Guard (`PreToolUse` + Terminal Guard + OS `chmod a-w`).
|
|
275
|
+
- Monotonic 3-Way YAML Merger preserving comments and formatting.
|
|
276
|
+
- LIFO Transactional Wave Rollback Engine with automated safety branches.
|
|
277
|
+
- Two-Stage Assisted (Interactive IDE Slots) operator execution standard (`Depth 0`).
|
|
278
|
+
- 5 Multi-SDD Adapters (BMAD, Spec Kit, GSD Artifact Hijack, OpenSpec, Beads).
|
|
279
|
+
- Standalone offline Merge-Bomb demo (`sdd-parallel demo`) and GitHub Actions CI suite.
|
|
280
|
+
- 95+ automated unit & integration tests, `mypy --strict`, and `ruff` quality gates.
|
|
281
|
+
|
|
282
|
+
### ๐ง Planned for `v0.2.0+`
|
|
283
|
+
- **Community Adapter Ecosystem:** `mattpocock/skills` (`/implement-spec`) and `bmad-loop` v0.8+ frontmatter status adapter.
|
|
284
|
+
- **Zero-Pollution Environment Sync:** `workz` pattern with `.venv` and `node_modules` symlinks into fixed slots.
|
|
285
|
+
- **Pre-Wave Static Symbol Linker & Scope Escalation:** Automatic write-set expansion via AST symbols and dynamic task rescheduling.
|
|
286
|
+
- **FinOps & Observability Exporters:** OpenTelemetry spans and Langfuse token savings telemetry.
|
|
287
|
+
- **Headless Autopilot Daemon:** Headless agent execution via local RPC/subagent dispatch.
|
|
288
|
+
|
|
289
|
+
---
|
|
290
|
+
|
|
291
|
+
## ๐งช Development & Quality Gates
|
|
292
|
+
|
|
293
|
+
Run the comprehensive test and validation suite locally:
|
|
294
|
+
|
|
295
|
+
```bash
|
|
296
|
+
# Run test suite
|
|
297
|
+
uv run pytest
|
|
298
|
+
|
|
299
|
+
# Run strict type checking
|
|
300
|
+
uv run mypy --strict src/sdd_parallel
|
|
301
|
+
|
|
302
|
+
# Run linter
|
|
303
|
+
uv run ruff check src/ tests/ scripts/
|
|
304
|
+
|
|
305
|
+
# Run standalone offline demo
|
|
306
|
+
uv run sdd-parallel demo
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
---
|
|
310
|
+
|
|
311
|
+
## ๐ค Contributing & Security
|
|
312
|
+
|
|
313
|
+
- **Contributing:** Please read our **[Contributing Guide](CONTRIBUTING.md)** for developer environment setup and pull request verification gates.
|
|
314
|
+
- **Security:** Security disclosures and vulnerability reporting instructions are outlined in our **[Security Policy](SECURITY.md)**.
|
|
315
|
+
|
|
316
|
+
---
|
|
317
|
+
|
|
318
|
+
## ๐ License
|
|
319
|
+
|
|
320
|
+
MIT License. See [LICENSE](LICENSE) for details.
|
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
# โก SDD-Parallel
|
|
2
|
+
|
|
3
|
+
[](https://github.com/stopActingSoSmall/sdd-parallel/actions/workflows/ci.yml)
|
|
4
|
+
[](https://www.python.org/)
|
|
5
|
+
[](LICENSE)
|
|
6
|
+
[](#-5-second-offline-demo-zero-api-keys)
|
|
7
|
+
|
|
8
|
+
<p align="center">
|
|
9
|
+
<b>๐ Language:</b>
|
|
10
|
+
<b>English</b> |
|
|
11
|
+
<a href="docs/i18n/zh-CN/README.md">็ฎไฝไธญๆ</a> |
|
|
12
|
+
<a href="docs/i18n/es/README.md">Espaรฑol</a> |
|
|
13
|
+
<a href="docs/i18n/pt-BR/README.md">Portuguรชs (BR)</a> |
|
|
14
|
+
<a href="docs/i18n/ja/README.md">ๆฅๆฌ่ช</a> |
|
|
15
|
+
<a href="docs/i18n/ko/README.md">ํ๊ตญ์ด</a> |
|
|
16
|
+
<a href="docs/i18n/ru/README.md">ะ ัััะบะธะน</a>
|
|
17
|
+
</p>
|
|
18
|
+
|
|
19
|
+
> **Spec-Driven Concurrency & Blast-Radius Governance Harness for AI Coding Agents**
|
|
20
|
+
> (Google Antigravity, Claude Code, OpenAI Codex)
|
|
21
|
+
> *Available as the `sdd-parallel` CLI and the convenient `parallel-flow` alias.*
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## ๐ฏ The Problem
|
|
26
|
+
|
|
27
|
+
Modern Spec-Driven Development (SDD) harnessesโ**BMAD Method (v6/v7)**, **GitHub Spec Kit (`.specify/`)**, **GSD (Get Shit Done)**, **OpenSpec**, and **Beads**โexcel at decomposing requirements into verifiable single-task specifications. However, they suffer from a **fatal architectural limitation when scaling to parallel execution**:
|
|
28
|
+
|
|
29
|
+
1. **Linear Story Queues:** Schedulers enforce strictly serial execution (`Story 1 -> Story 2 -> Story 3`), ignoring independent epics.
|
|
30
|
+
2. **Merge-Bombs in Shared Configs:** Concurrent agents collide on shared registries and sprint status files (`sprint-status.yaml`, `STATE.md`, `tasks.md`).
|
|
31
|
+
3. **Type-2 Semantic Collisions ($W_A \cap I_B \neq \emptyset$):** Agent A refactors a shared interface, while concurrent Agent B calls the previous signature. Local git branches pass tests in isolation, but fail catastrophically upon merging.
|
|
32
|
+
4. **Subagent Depth Limits:** Complex multi-agent workflows (like BMAD's 3 review lenses) break when nested inside flat subagents (`Max Subagent Depth = 1`).
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## ๐ก The Solution: `sdd-parallel`
|
|
37
|
+
|
|
38
|
+
`sdd-parallel` is a deterministic orchestration and safety harness that:
|
|
39
|
+
- **Analyzes SDD Roadmaps Polymorphically:** Zero hardcoding; extracts tasks, dependencies, and code maps across 5 SDD frameworks.
|
|
40
|
+
- **Solves Semantic Blast Radius (AST + Call Graph):** Calculates directed dependencies, Spine Locks, and Type-2 impact overlaps ($W_A \cap I_B$).
|
|
41
|
+
- **Provisions Fixed Track Slots (`track-a`, `track-b`, ...):** Allocates permanent worktree slots with in-place reset (`git checkout -B` + `git clean -fd`), preserving an $O(1)$ disk footprint.
|
|
42
|
+
- **Enforces a Three-Tier Scope Guard:** Intercepts out-of-scope edits via `PreToolUse` hooks, blocks shell escapes in `Bash`/PowerShell, and locks sensitive files via OS `chmod a-w`.
|
|
43
|
+
- **Performs Monotonic 3-Way Merges:** Reconciles sprint statuses via monotonic lattice resolution ($\max(\text{rank})$) with zero `<<<<<<<` conflict markers.
|
|
44
|
+
- **Guarantees LIFO Transactional Rollbacks:** Safely reverses merged waves with automated backup branches and polymorphic SDD task status resets.
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## ๐ 5-Second Offline Demo (Zero API Keys)
|
|
49
|
+
|
|
50
|
+
Clone the repository and run the standalone verification demo offline:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
uv run sdd-parallel demo
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
```text
|
|
57
|
+
============================================================================
|
|
58
|
+
SDD-PARALLEL STANDALONE MERGE-BOMB DEMO (ZERO API KEYS / OFFLINE)
|
|
59
|
+
============================================================================
|
|
60
|
+
Workspace: /tmp/sdd-parallel-demo-xyz
|
|
61
|
+
|
|
62
|
+
[Step 1/4] AST & Architectural Role Classification
|
|
63
|
+
----------------------------------------------------------------------------
|
|
64
|
+
File Path | Detected Role | Importers
|
|
65
|
+
----------------------------------------------------------------------------
|
|
66
|
+
src/demo_app/__init__.py | additive_registry | -
|
|
67
|
+
src/demo_app/api.py | standard | -
|
|
68
|
+
src/demo_app/cli.py | additive_registry | -
|
|
69
|
+
src/demo_app/exporter.py | standard | -
|
|
70
|
+
src/demo_app/normalizer.py | standard | src/demo_app/api.py
|
|
71
|
+
src/demo_app/schema.py | spine | -
|
|
72
|
+
|
|
73
|
+
[Step 2/4] Type-2 Semantic Merge-Bomb Detection & BSP Wave Schedule
|
|
74
|
+
----------------------------------------------------------------------------
|
|
75
|
+
Collision Analysis:
|
|
76
|
+
- Naive Scheduler : W(1-2)={normalizer.py, cli.py} vs W(2-1)={api.py}
|
|
77
|
+
-> DISJOINT WRITES (False Safe!)
|
|
78
|
+
- BSPWaveScheduler: Detected semantic_collision between '1-2' and '2-1'
|
|
79
|
+
-> Overlap W(1-2) ^ I(2-1) on: src/demo_app/api.py
|
|
80
|
+
- Additive Registry: Tasks '1-2' and '1-3' both touch 'src/demo_app/cli.py'
|
|
81
|
+
-> Role: ADDITIVE_REGISTRY (Parallel allowed in Wave 1)
|
|
82
|
+
|
|
83
|
+
Wave Schedule:
|
|
84
|
+
* Wave 1
|
|
85
|
+
- track-a: Story 1-2 -> writes: src/demo_app/normalizer.py (+ shared: src/demo_app/cli.py)
|
|
86
|
+
- track-b: Story 1-3 -> writes: src/demo_app/exporter.py (+ shared: src/demo_app/cli.py)
|
|
87
|
+
* Wave 2
|
|
88
|
+
- track-a: Story 1-1 -> writes: src/demo_app/schema.py
|
|
89
|
+
- track-b: Story 2-1 -> writes: src/demo_app/api.py
|
|
90
|
+
* Wave 3
|
|
91
|
+
- track-a: Story 2-2 -> writes: src/demo_app/schema.py
|
|
92
|
+
|
|
93
|
+
[Step 3/4] Fixed-Slot Worktree Provisioning & PreToolUse Scope Guard
|
|
94
|
+
----------------------------------------------------------------------------
|
|
95
|
+
Provisioned Fixed Slots (100% Clean git status: True):
|
|
96
|
+
- track-a (.worktrees/track-a)
|
|
97
|
+
- track-b (.worktrees/track-b)
|
|
98
|
+
|
|
99
|
+
PreToolUse Scope Guard Check (track-a -> 'src/demo_app/schema.py'):
|
|
100
|
+
- Decision : DENY
|
|
101
|
+
- Violation: File 'src/demo_app/schema.py' cannot be modified by Wave 1 / track-a (stories ['1-2'])
|
|
102
|
+
- Reason : Locked by Spine Chain invariant.
|
|
103
|
+
|
|
104
|
+
[Step 4/4] Barrier Checkpoint & Monotonic 3-Way YAML Merge
|
|
105
|
+
----------------------------------------------------------------------------
|
|
106
|
+
Merged Branches:
|
|
107
|
+
- parallel/track-a
|
|
108
|
+
- parallel/track-b
|
|
109
|
+
|
|
110
|
+
Resolved sprint-status.yaml (0 conflict markers):
|
|
111
|
+
- 1-2-normalize-telemetry-payload: done
|
|
112
|
+
- 1-3-cli-batch-export: done
|
|
113
|
+
============================================================================
|
|
114
|
+
ALL 5 CORE INVARIANTS VERIFIED IN 3.21s
|
|
115
|
+
============================================================================
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
> ๐ **Step-by-Step Demo Anatomy, Graph Theory & Interactive Sandbox Quest:**
|
|
119
|
+
> Want to see frame-by-frame disk snapshots (`Before -> Wave Planning -> Slot Locking -> 3-Way Merge`), understand the graph theory behind `SPINE` / `ADDITIVE_REGISTRY` / `STANDARD` (3-pass `ASTHotspotScanner`), and hands-on test `plan`, `prepare`, `check-lock`, `abort-wave`, and `rollback-wave` inside a live `--keep-temp` sandbox or greenfield repository?
|
|
120
|
+
> ๐ Read the algorithmic foundation in **[System Capabilities & Architectural White Paper](docs/dossier/02_SYSTEM_CAPABILITIES_WHITE_PAPER.md)** and walk through the **[Standalone Demo & Interactive E2E Walkthrough Guide](docs/dossier/07_STANDALONE_DEMO_AND_E2E_WALKTHROUGH.md)** *(part of the canonical **[Architecture & Strategy Dossier](docs/dossier/README.md)**; Russian original in **[docs/i18n/ru/dossier/](docs/i18n/ru/dossier/)**).
|
|
121
|
+
> ๐๏ธ For executive decision-makers and architects: **[Product Brief & Executive Summary](docs/dossier/01_CORE_PRODUCT_BRIEF.md)** | **[System Architecture SSOT](ARCHITECTURE.md)**.
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## ๐ฆ Requirements & Installation
|
|
126
|
+
|
|
127
|
+
### Prerequisites
|
|
128
|
+
- **Python:** `>= 3.11` (Python 3.11, 3.12, 3.13)
|
|
129
|
+
- **Git:** `>= 2.30` (required for modern `git worktree` isolation and `info/exclude` masking)
|
|
130
|
+
- **Package Manager:** [`uv`](https://docs.astral.sh/uv/) (recommended) or `pipx`
|
|
131
|
+
|
|
132
|
+
### Installation
|
|
133
|
+
|
|
134
|
+
#### As an isolated CLI tool (Recommended)
|
|
135
|
+
```bash
|
|
136
|
+
# Using uv (fastest)
|
|
137
|
+
uv tool install sdd-parallel
|
|
138
|
+
|
|
139
|
+
# Or using pipx
|
|
140
|
+
pipx install sdd-parallel
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
#### From source for local development
|
|
144
|
+
```bash
|
|
145
|
+
git clone https://github.com/stopActingSoSmall/sdd-parallel.git
|
|
146
|
+
cd sdd-parallel
|
|
147
|
+
uv sync
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
After installation, the CLI is available globally via `sdd-parallel` (or short alias `parallel-flow`).
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
## ๐๏ธ System Architecture
|
|
155
|
+
|
|
156
|
+
```mermaid
|
|
157
|
+
flowchart TD
|
|
158
|
+
subgraph Inputs["1. Multi-SDD Roadmap Adapters"]
|
|
159
|
+
BMAD["BMAD Method (v6/v7)"]
|
|
160
|
+
SpecKit["GitHub Spec Kit (.specify/)"]
|
|
161
|
+
GSD["GSD Artifact Hijack (.planning/)"]
|
|
162
|
+
OpenSpec["OpenSpec (openspec/changes/)"]
|
|
163
|
+
Beads["Beads (.beads/issues.jsonl)"]
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
subgraph Engine["2. Hybrid DAG & Blast-Radius Engine"]
|
|
167
|
+
AST["Universal AST Classifier\n(SPINE, ADDITIVE_REGISTRY, STANDARD)"]
|
|
168
|
+
CRG["CRGSidecarAdapter\n(code-review-graph v2.3.9 WAL)"]
|
|
169
|
+
BSP["Deterministic BSPWaveScheduler\n(K-Track Waves, Kahn Acyclicity)"]
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
subgraph Actuation["3. Actuation & Scope Guard"]
|
|
173
|
+
Slots["Fixed Track Slots (track-a/b/c)\n(In-Place Reset, core.fileMode false)"]
|
|
174
|
+
Guard["Three-Tier Scope Guard\n(PreToolUse + Terminal Guard + chmod a-w)"]
|
|
175
|
+
Verify["verify-wave Gate\n(git diff merge-base...HEAD audit)"]
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
subgraph Barrier["4. Barrier Checkpoint & Rollback"]
|
|
179
|
+
Merge["merge-wave Checkpoint\n(3-Way Monotonic YAML Merger)"]
|
|
180
|
+
Rollback["LIFO Rollback Engine\n(abort-wave / rollback-wave --save-backup)"]
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
Inputs --> AST & CRG
|
|
184
|
+
AST & CRG --> BSP
|
|
185
|
+
BSP --> Slots
|
|
186
|
+
Slots --> Guard --> Verify
|
|
187
|
+
Verify --> Merge
|
|
188
|
+
Merge -. Error / Revert .-> Rollback
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
## ๐ก๏ธ Core Invariants
|
|
194
|
+
|
|
195
|
+
1. **Zero Worktree Pollution:** Injected boundaries (`.tmp/track-context.md`, `.parallel-lock.json`, `ACTIVE_TRACK.md`) are masked via git `info/exclude`. `git status --porcelain` is always 100% clean.
|
|
196
|
+
2. **Zero Cache Invalidation:** Epics contexts in `_bmad-output/planning-artifacts/` are read-only; planner state writes to `_bmad-output/parallel-artifacts/`.
|
|
197
|
+
3. **100% Task Coverage & Acyclic Invariant:** Kahn/Tarjan topological verification guarantees zero lost stories and zero dependency cycles.
|
|
198
|
+
4. **Blast-Radius Enforcement (Type-1 & Type-2):** Disjoint writes ($W_A \cap W_B = \emptyset$) plus disjoint semantic impacts ($W_A \cap I_B = \emptyset$).
|
|
199
|
+
5. **Universal Anti-Overfitting (Invariant 7):** Zero domain-specific path or entity hardcoding in the core engine. Classifies `SPINE`, `ADDITIVE_REGISTRY`, and `STANDARD` strictly through AST heuristics and graph centrality.
|
|
200
|
+
6. **Fixed Track Slots ($O(1)$ Footprint):** Reuses slots `track-a`, `track-b`, `track-c` via `git checkout -B` and `git clean -fd` to prevent UI folder clutter.
|
|
201
|
+
7. **Three-Tier Defense-in-Depth Guard:** `PreToolUse` hook + Terminal command interception (`Bash`, `run_command`) + OS `chmod a-w` file protection.
|
|
202
|
+
8. **Monotonic Status Semi-Lattice:** Statuses resolve monotonically: $\texttt{backlog} (0) < \dots < \texttt{done} (4)$ without merge markers.
|
|
203
|
+
9. **LIFO Transactional Rollbacks:** Reverts merged waves strictly in reverse order with automated safety backup branches (`backup/wave-<K>-before-rollback-*`).
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
## ๐ ๏ธ CLI Reference
|
|
208
|
+
|
|
209
|
+
| Command | Purpose |
|
|
210
|
+
| :--- | :--- |
|
|
211
|
+
| `sdd-parallel demo [--kit {bmad,spec-kit,gsd,openspec,beads,all}] [--keep-temp] [--scaffold-only] [--output-dir DIR]` | Run the standalone offline Merge-Bomb demo or scaffold an interactive sandbox across 5 SDD kits. |
|
|
212
|
+
| `sdd-parallel plan [--repo REPO] [--max-tracks N] [--kit auto] [--include-done] [--dry-run] [--plan-source {auto,plan,specs}] [--output-dir DIR]` | Analyze roadmap and codebase graph; generate `execution-plan-parallel.md` and `wave-plan.json`. |
|
|
213
|
+
| `sdd-parallel prepare --wave K [--repo REPO] [--max-tracks N] [--kit KIT] [--headless] [--antigravity-layout] [--dynamic-worktrees] [--dry-run]` | Provision worktree slots (`track-a`, `track-b`), configure OS locks, and inject boundaries. |
|
|
214
|
+
| `sdd-parallel claim-track --wave K --track <id> --worktree <path> [--repo REPO] [--max-tracks N] [--kit KIT] [--headless]` | Attach boundary locks to an existing external worktree slot. |
|
|
215
|
+
| `sdd-parallel run-guide --wave K [--repo REPO] [--max-tracks N] [--kit KIT] [--antigravity-layout]` | Display interactive operator run-guide matrix with launch commands for each active track window. |
|
|
216
|
+
| `sdd-parallel verify-wave --wave K [--repo REPO] [--max-tracks N] [--kit KIT] [--dynamic-worktrees]` | Audit worktrees against `.parallel-lock.json` and multi-commit diff against `merge-base`. |
|
|
217
|
+
| `sdd-parallel merge --wave K [--repo REPO] [--max-tracks N] [--kit KIT] [--dynamic-worktrees] [--skip-gates] [--strict-gates] [--cleanup] [--dry-run]` | Barrier checkpoint merge: 3-way status merge, git merge, polymorphic quality gates, and transactional auto-rollback. |
|
|
218
|
+
| `sdd-parallel abort-wave --wave K [--repo REPO] [--dynamic-worktrees]` | Abort unmerged wave: reset slots and remove temporary parallel branches. |
|
|
219
|
+
| `sdd-parallel rollback-wave --wave K [--repo REPO] [--dynamic-worktrees] [--to-commit COMMIT] [--save-backup] [--no-backup] [--kit KIT]` | Revert merged wave in LIFO order with safety backup branch and SDD task status reset. |
|
|
220
|
+
| `sdd-parallel merge-status --base B --ours O --theirs T --out OUT` | Low-level 3-way deterministic merge tool for `sprint-status.yaml`. |
|
|
221
|
+
| `sdd-parallel check-lock --file PATH [--tool TOOL]` | Validate file write permissions against active worktree lock manifest. |
|
|
222
|
+
| `sdd-parallel install-plugin [--target-dir DIR]` | Package and install the portable Antigravity plugin. |
|
|
223
|
+
| `sdd-parallel autopilot --wave K [--repo REPO] [--max-tracks N] [--kit KIT] [--harness <tool>] [--antigravity-layout] [--execute]` | Generate or execute Multi-Conversation Autopilot launch commands with Model Effort Routing. |
|
|
224
|
+
|
|
225
|
+
---
|
|
226
|
+
|
|
227
|
+
## ๐งฉ Supported SDD Kits
|
|
228
|
+
|
|
229
|
+
| SDD Framework | Status | Read-Only Artifacts Detected | Task State Synchronization |
|
|
230
|
+
| :--- | :---: | :--- | :--- |
|
|
231
|
+
| **BMAD Method (`v6.3+` / `v7`)** | โ
Shipped | `sprint-status.yaml`, `epics.md`, `epic-*-context.md`, `spec-*.md` | Monotonic 3-way YAML merge |
|
|
232
|
+
| **GitHub Spec Kit (`.specify/`)** | โ
Shipped | `.specify/specs/*/tasks.md`, `constitution.md` | Markdown status checkboxes |
|
|
233
|
+
| **GSD (Get Shit Done)** | โ
Shipped | `.planning/phases/*-PLAN.md`, `ROADMAP.md` | Artifact Hijack (`STATE.md` central update) |
|
|
234
|
+
| **OpenSpec (`openspec/`)** | โ
Shipped | `openspec/changes/<id>/tasks.md` | Spec-driven task state tracking |
|
|
235
|
+
| **Beads (`.beads/`)** | โ
Shipped | `.beads/issues.jsonl` | Topological issue state updates |
|
|
236
|
+
|
|
237
|
+
---
|
|
238
|
+
|
|
239
|
+
## ๐ข Release Matrix: Shipped (`v0.1.0`) vs Roadmap (`v0.2+`)
|
|
240
|
+
|
|
241
|
+
### โ
Shipped in `v0.1.0` (Production Hardened)
|
|
242
|
+
- Deterministic Bulk-Synchronous Parallel (BSP) wave scheduler with Kahn acyclicity.
|
|
243
|
+
- AST Hotspot Scanner & `code-review-graph v2.3.9` sidecar integration.
|
|
244
|
+
- Fixed Track Slots architecture (`track-a`, `track-b`, `track-c`) with in-place reset.
|
|
245
|
+
- Three-Tier Defense-in-Depth Scope Guard (`PreToolUse` + Terminal Guard + OS `chmod a-w`).
|
|
246
|
+
- Monotonic 3-Way YAML Merger preserving comments and formatting.
|
|
247
|
+
- LIFO Transactional Wave Rollback Engine with automated safety branches.
|
|
248
|
+
- Two-Stage Assisted (Interactive IDE Slots) operator execution standard (`Depth 0`).
|
|
249
|
+
- 5 Multi-SDD Adapters (BMAD, Spec Kit, GSD Artifact Hijack, OpenSpec, Beads).
|
|
250
|
+
- Standalone offline Merge-Bomb demo (`sdd-parallel demo`) and GitHub Actions CI suite.
|
|
251
|
+
- 95+ automated unit & integration tests, `mypy --strict`, and `ruff` quality gates.
|
|
252
|
+
|
|
253
|
+
### ๐ง Planned for `v0.2.0+`
|
|
254
|
+
- **Community Adapter Ecosystem:** `mattpocock/skills` (`/implement-spec`) and `bmad-loop` v0.8+ frontmatter status adapter.
|
|
255
|
+
- **Zero-Pollution Environment Sync:** `workz` pattern with `.venv` and `node_modules` symlinks into fixed slots.
|
|
256
|
+
- **Pre-Wave Static Symbol Linker & Scope Escalation:** Automatic write-set expansion via AST symbols and dynamic task rescheduling.
|
|
257
|
+
- **FinOps & Observability Exporters:** OpenTelemetry spans and Langfuse token savings telemetry.
|
|
258
|
+
- **Headless Autopilot Daemon:** Headless agent execution via local RPC/subagent dispatch.
|
|
259
|
+
|
|
260
|
+
---
|
|
261
|
+
|
|
262
|
+
## ๐งช Development & Quality Gates
|
|
263
|
+
|
|
264
|
+
Run the comprehensive test and validation suite locally:
|
|
265
|
+
|
|
266
|
+
```bash
|
|
267
|
+
# Run test suite
|
|
268
|
+
uv run pytest
|
|
269
|
+
|
|
270
|
+
# Run strict type checking
|
|
271
|
+
uv run mypy --strict src/sdd_parallel
|
|
272
|
+
|
|
273
|
+
# Run linter
|
|
274
|
+
uv run ruff check src/ tests/ scripts/
|
|
275
|
+
|
|
276
|
+
# Run standalone offline demo
|
|
277
|
+
uv run sdd-parallel demo
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
---
|
|
281
|
+
|
|
282
|
+
## ๐ค Contributing & Security
|
|
283
|
+
|
|
284
|
+
- **Contributing:** Please read our **[Contributing Guide](CONTRIBUTING.md)** for developer environment setup and pull request verification gates.
|
|
285
|
+
- **Security:** Security disclosures and vulnerability reporting instructions are outlined in our **[Security Policy](SECURITY.md)**.
|
|
286
|
+
|
|
287
|
+
---
|
|
288
|
+
|
|
289
|
+
## ๐ License
|
|
290
|
+
|
|
291
|
+
MIT License. See [LICENSE](LICENSE) for details.
|