@the-bearded-bear/claude-craft 4.4.0 → 5.0.0-next.fa2403f
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.
- package/Dev/i18n/de/Common/commands/ralph-sprint.md +159 -0
- package/Dev/i18n/en/Common/commands/ralph-sprint.md +293 -0
- package/Dev/i18n/es/Common/commands/ralph-sprint.md +159 -0
- package/Dev/i18n/fr/Common/commands/ralph-sprint.md +281 -0
- package/Dev/i18n/pt/Common/commands/ralph-sprint.md +159 -0
- package/Dev/scripts/install-angular-rules.sh +1 -1
- package/Dev/scripts/install-common-rules.sh +1 -1
- package/Dev/scripts/install-csharp-rules.sh +1 -1
- package/Dev/scripts/install-flutter-rules.sh +1 -1
- package/Dev/scripts/install-laravel-rules.sh +1 -1
- package/Dev/scripts/install-php-rules.sh +1 -1
- package/Dev/scripts/install-python-rules.sh +1 -1
- package/Dev/scripts/install-react-rules.sh +1 -1
- package/Dev/scripts/install-reactnative-rules.sh +1 -1
- package/Dev/scripts/install-symfony-rules.sh +1 -1
- package/Dev/scripts/install-vuejs-rules.sh +1 -1
- package/README.md +23 -0
- package/Tools/Ralph/README.md +72 -11
- package/Tools/Ralph/config/ralph-autonomous.yml +139 -0
- package/Tools/Ralph/docs/PARALLEL.md +458 -0
- package/Tools/Ralph/docs/RECOVERY.md +371 -0
- package/Tools/Ralph/lib/circuit-breaker.sh +184 -1
- package/Tools/Ralph/lib/escalation-service.sh +611 -0
- package/Tools/Ralph/lib/parallel-manager.sh +602 -0
- package/Tools/Ralph/lib/recovery-engine.sh +606 -0
- package/Tools/Ralph/lib/sprint-conductor.sh +1000 -0
- package/Tools/Ralph/ralph.sh +106 -2
- package/package.json +1 -1
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Autonomen Sprint-Conductor fur Overnight/unbeaufsichtigte Sprint-Ausfuhrung starten
|
|
3
|
+
argument-hint: <sprint-name> [--overnight|--parallel N|--supervised|--max-stories N]
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Ralph Sprint - Autonomer Sprint Conductor (ASC)
|
|
7
|
+
|
|
8
|
+
Fuhrt einen gesamten Sprint autonom mit minimaler menschlicher Intervention aus. Der Autonome Sprint Conductor (ASC) verwaltet Story-Claiming, Ausfuhrung, Ubergange, Fehlerwiederherstellung und Eskalation blockierender Probleme.
|
|
9
|
+
|
|
10
|
+
## Argumente
|
|
11
|
+
|
|
12
|
+
**$ARGUMENTS**
|
|
13
|
+
|
|
14
|
+
- `<sprint-name>`: Name oder ID des zu verarbeitenden Sprints
|
|
15
|
+
- `--overnight`: Overnight-Modus (begrenzt, stoppt um 6 Uhr)
|
|
16
|
+
- `--parallel N`: Bis zu N Stories parallel verarbeiten (Standard: 1)
|
|
17
|
+
- `--supervised`: Pause vor jeder Story zur Bestatigung
|
|
18
|
+
- `--max-stories N`: Maximale Stories zu verarbeiten (Standard: 10)
|
|
19
|
+
- `--timeout H`: Maximale Laufzeit in Stunden (Standard: 12)
|
|
20
|
+
|
|
21
|
+
## Hauptfunktionen
|
|
22
|
+
|
|
23
|
+
| Funktion | Beschreibung |
|
|
24
|
+
|----------|--------------|
|
|
25
|
+
| **Auto-Claim** | Beansprucht automatisch die nachste bereite Story |
|
|
26
|
+
| **Auto-Transition** | Ubergangsgeschichten basierend auf Abschlussstatus |
|
|
27
|
+
| **Recovery Engine** | Automatische Wiederherstellung von vorubergehenden/behebbaren Fehlern |
|
|
28
|
+
| **Eskalationsdienst** | Warteschlange fur blockierende Probleme zur menschlichen Losung |
|
|
29
|
+
| **Parallelverarbeitung** | Verarbeitet mehrere unabhangige Stories gleichzeitig |
|
|
30
|
+
| **Begrenzte Ausfuhrung** | Zeitfenster, Story-Limits, Fehlerschwellen |
|
|
31
|
+
|
|
32
|
+
## Prozess
|
|
33
|
+
|
|
34
|
+
### 1. Sprint-Initialisierung
|
|
35
|
+
|
|
36
|
+
1. **Sprint-Konfiguration laden**:
|
|
37
|
+
- Metadaten aus `.bmad/sprint-status.yaml` lesen
|
|
38
|
+
- Autonome Konfiguration aus `ralph-autonomous.yml` laden
|
|
39
|
+
- Recovery Engine und Eskalationsdienst initialisieren
|
|
40
|
+
|
|
41
|
+
2. **Autonomen Modus aktivieren**:
|
|
42
|
+
- Circuit Breaker auf autonomes Profil setzen
|
|
43
|
+
- Wiederherstellung vor Auslosung aktivieren
|
|
44
|
+
- Parallel Manager initialisieren falls aktiviert
|
|
45
|
+
|
|
46
|
+
### 2. Hauptschleife des Conductors
|
|
47
|
+
|
|
48
|
+
Der ASC fuhrt eine kontinuierliche Schleife aus:
|
|
49
|
+
|
|
50
|
+
1. Stoppbedingungen prufen
|
|
51
|
+
2. Nachste bereite Story holen
|
|
52
|
+
3. Story beanspruchen
|
|
53
|
+
4. Mit Ralph ausfuhren
|
|
54
|
+
5. Ergebnis verarbeiten (Erfolg/Fehler/Eskaliert)
|
|
55
|
+
6. Story transitieren
|
|
56
|
+
7. Checkpoint erstellen
|
|
57
|
+
|
|
58
|
+
### 3. Fehlerwiederherstellung
|
|
59
|
+
|
|
60
|
+
Die Recovery Engine klassifiziert Fehler in 4 Stufen:
|
|
61
|
+
|
|
62
|
+
| Stufe | Typ | Aktion | Beispiele |
|
|
63
|
+
|-------|-----|--------|-----------|
|
|
64
|
+
| 0 | **Vorubergehend** | Auto-Retry mit Backoff | Timeout, Rate Limit, Netzwerk |
|
|
65
|
+
| 1 | **Behebbar** | Auto-Fix + Retry | Lint, Tests, Deps, Syntax |
|
|
66
|
+
| 2 | **Degradiert** | Fortsetzen mit Warnung | Docs, optionale Gates |
|
|
67
|
+
| 3 | **Blockiert** | An Menschen eskalieren | Sicherheit, Architektur |
|
|
68
|
+
|
|
69
|
+
### 4. Eskalationsmanagement
|
|
70
|
+
|
|
71
|
+
Blockierende Probleme werden fur menschliche Losung in die Warteschlange gestellt.
|
|
72
|
+
|
|
73
|
+
**Losungsoptionen**:
|
|
74
|
+
- `proceed` - Mit der Aufgabe fortfahren
|
|
75
|
+
- `skip` - Diese Story uberspringen und fortfahren
|
|
76
|
+
- `retry` - Fehlgeschlagene Operation erneut versuchen
|
|
77
|
+
- `abort` - Sprint stoppen
|
|
78
|
+
|
|
79
|
+
### 5. Stoppbedingungen
|
|
80
|
+
|
|
81
|
+
| Bedingung | Standard | Beschreibung |
|
|
82
|
+
|-----------|----------|--------------|
|
|
83
|
+
| Max Stories | 10 | Maximale verarbeitete Stories |
|
|
84
|
+
| Max Fehler | 3 | Schwelle fur aufeinanderfolgende Fehler |
|
|
85
|
+
| Max Laufzeit | 12h | Maximale Gesamtlaufzeit |
|
|
86
|
+
| Stoppfenster | 06:00 | Zeitbasierter Stopp (Overnight) |
|
|
87
|
+
| Kritische Eskalation | - | Pause bei kritischen Problemen |
|
|
88
|
+
|
|
89
|
+
## Schnellstart-Beispiele
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
# Overnight-Sprint
|
|
93
|
+
/common:ralph-sprint "Sprint 3" --overnight
|
|
94
|
+
|
|
95
|
+
# Parallelverarbeitung mit 3 Sitzungen
|
|
96
|
+
/common:ralph-sprint "Sprint 3" --parallel 3
|
|
97
|
+
|
|
98
|
+
# Uberwachter Modus
|
|
99
|
+
/common:ralph-sprint "Sprint 3" --supervised
|
|
100
|
+
|
|
101
|
+
# Begrenzte Ausfuhrung
|
|
102
|
+
/common:ralph-sprint "Sprint 3" --max-stories 5 --timeout 4
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## Konfiguration
|
|
106
|
+
|
|
107
|
+
Der ASC verwendet `Tools/Ralph/config/ralph-autonomous.yml`:
|
|
108
|
+
|
|
109
|
+
```yaml
|
|
110
|
+
autonomous:
|
|
111
|
+
enabled: true
|
|
112
|
+
mode: "bounded"
|
|
113
|
+
schedule:
|
|
114
|
+
stop_window: "06:00"
|
|
115
|
+
max_runtime_hours: 12
|
|
116
|
+
limits:
|
|
117
|
+
max_stories_per_session: 10
|
|
118
|
+
max_consecutive_failures: 3
|
|
119
|
+
parallel:
|
|
120
|
+
enabled: false
|
|
121
|
+
max_concurrent: 3
|
|
122
|
+
|
|
123
|
+
recovery:
|
|
124
|
+
enabled: true
|
|
125
|
+
max_attempts: 3
|
|
126
|
+
auto_fix_lint: true
|
|
127
|
+
auto_fix_tests: "retry_tdd"
|
|
128
|
+
|
|
129
|
+
escalation:
|
|
130
|
+
enabled: true
|
|
131
|
+
timeout_hours: 4
|
|
132
|
+
default_action: "skip"
|
|
133
|
+
critical_action: "pause"
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## Erfolgsmetriken
|
|
137
|
+
|
|
138
|
+
| Metrik | Aktuell | Ziel |
|
|
139
|
+
|--------|---------|------|
|
|
140
|
+
| Menschliche Eingriffe/Sprint | ~15 | <5 |
|
|
141
|
+
| Overnight abgeschlossene Stories | 0 | 3-5 |
|
|
142
|
+
| Auto-Wiederherstellungsrate | N/A | >70% |
|
|
143
|
+
| Zeit bis Eskalation | N/A | <15 min |
|
|
144
|
+
| Parallelisierungseffizienz | N/A | >60% |
|
|
145
|
+
|
|
146
|
+
## Best Practices
|
|
147
|
+
|
|
148
|
+
1. **Uberwacht beginnen**: Zuerst `--supervised` verwenden
|
|
149
|
+
2. **Realistische Limits**: max-stories anfangs nicht zu hoch setzen
|
|
150
|
+
3. **Eskalationen uberwachen**: `.ralph/escalations/queue/` regelmasig prufen
|
|
151
|
+
4. **Metriken analysieren**: `metrics-*.json` nach jedem Lauf untersuchen
|
|
152
|
+
5. **Webhooks konfigurieren**: Slack/Teams-Benachrichtigungen fur kritische Probleme
|
|
153
|
+
|
|
154
|
+
## Verwandt
|
|
155
|
+
|
|
156
|
+
- `/common:ralph-run` - Kontinuierliche Schleife fur eine Aufgabe
|
|
157
|
+
- `/project:run-sprint` - Standard-Sprint-Ausfuhrung
|
|
158
|
+
- `/sprint:next-story` - Nachste bereite Story holen
|
|
159
|
+
- `@ralph-conductor` - Ralph-Orchestrierungsagent
|
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Run autonomous sprint conductor for overnight/unattended sprint execution
|
|
3
|
+
argument-hint: <sprint-name> [--overnight|--parallel N|--supervised|--max-stories N]
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Ralph Sprint - Autonomous Sprint Conductor (ASC)
|
|
7
|
+
|
|
8
|
+
Execute an entire sprint autonomously with minimal human intervention. The Autonomous Sprint Conductor (ASC) manages story claiming, execution, transitions, recovery from errors, and escalation of blocking issues.
|
|
9
|
+
|
|
10
|
+
## Arguments
|
|
11
|
+
|
|
12
|
+
**$ARGUMENTS**
|
|
13
|
+
|
|
14
|
+
- `<sprint-name>`: Name or ID of the sprint to process
|
|
15
|
+
- `--overnight`: Run in overnight mode (bounded, stops at 6am)
|
|
16
|
+
- `--parallel N`: Process up to N stories in parallel (default: 1)
|
|
17
|
+
- `--supervised`: Pause before each story for confirmation
|
|
18
|
+
- `--max-stories N`: Maximum stories to process (default: 10)
|
|
19
|
+
- `--timeout H`: Maximum runtime in hours (default: 12)
|
|
20
|
+
|
|
21
|
+
## Key Features
|
|
22
|
+
|
|
23
|
+
| Feature | Description |
|
|
24
|
+
|---------|-------------|
|
|
25
|
+
| **Auto-Claim** | Automatically claims next ready-for-dev story |
|
|
26
|
+
| **Auto-Transition** | Transitions stories based on completion state |
|
|
27
|
+
| **Recovery Engine** | Auto-recovers from transient/recoverable errors |
|
|
28
|
+
| **Escalation Service** | Queues blocking issues for human resolution |
|
|
29
|
+
| **Parallel Processing** | Process multiple independent stories concurrently |
|
|
30
|
+
| **Bounded Execution** | Time windows, story limits, failure thresholds |
|
|
31
|
+
|
|
32
|
+
## Process
|
|
33
|
+
|
|
34
|
+
### 1. Sprint Initialization
|
|
35
|
+
|
|
36
|
+
1. **Load sprint configuration**:
|
|
37
|
+
- Read sprint metadata from `.bmad/sprint-status.yaml`
|
|
38
|
+
- Load autonomous config from `ralph-autonomous.yml`
|
|
39
|
+
- Initialize recovery engine and escalation service
|
|
40
|
+
|
|
41
|
+
2. **Enable autonomous mode**:
|
|
42
|
+
- Set circuit breaker to autonomous profile
|
|
43
|
+
- Enable recovery before trip
|
|
44
|
+
- Initialize parallel manager if enabled
|
|
45
|
+
|
|
46
|
+
### 2. Main Conductor Loop
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
50
|
+
│ AUTONOMOUS SPRINT CONDUCTOR (ASC) │
|
|
51
|
+
└───────────────────────────────┬─────────────────────────────────┘
|
|
52
|
+
│
|
|
53
|
+
┌───────────────────────────┼───────────────────────────────┐
|
|
54
|
+
▼ ▼ ▼
|
|
55
|
+
┌─────────┐ ┌─────────────┐ ┌─────────────┐
|
|
56
|
+
│Get Next │──────────────│ Claim Story │───────────────│Execute with │
|
|
57
|
+
│ Story │ │ │ │ Ralph │
|
|
58
|
+
└────┬────┘ └─────────────┘ └──────┬──────┘
|
|
59
|
+
│ │
|
|
60
|
+
│ No stories ──────────────────┐ ┌──────────────┘
|
|
61
|
+
▼ ▼ ▼
|
|
62
|
+
┌─────────┐ ┌─────────┐ ┌─────────┐
|
|
63
|
+
│ Check │ │Finalize │ │Transition│
|
|
64
|
+
│Escalate │ │ Sprint │ │ Story │
|
|
65
|
+
└─────────┘ └─────────┘ └─────────┘
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### 3. Error Recovery
|
|
69
|
+
|
|
70
|
+
The Recovery Engine classifies errors into 4 levels:
|
|
71
|
+
|
|
72
|
+
| Level | Type | Action | Examples |
|
|
73
|
+
|-------|------|--------|----------|
|
|
74
|
+
| 0 | **Transient** | Auto-retry with backoff | Timeout, rate limit, network |
|
|
75
|
+
| 1 | **Recoverable** | Auto-fix + retry | Lint, tests, deps, syntax |
|
|
76
|
+
| 2 | **Degraded** | Continue with warning | Docs, optional gates, coverage |
|
|
77
|
+
| 3 | **Blocked** | Escalate to human | Security, architecture, auth |
|
|
78
|
+
|
|
79
|
+
### 4. Escalation Management
|
|
80
|
+
|
|
81
|
+
Blocking issues are queued for human resolution:
|
|
82
|
+
|
|
83
|
+
```yaml
|
|
84
|
+
# .ralph/escalations/queue/ESC-xxx.yaml
|
|
85
|
+
id: "ESC-1704067200-123"
|
|
86
|
+
level: "blocked"
|
|
87
|
+
error_type: "security"
|
|
88
|
+
priority: "critical"
|
|
89
|
+
timeout_at: "2024-01-02T10:00:00Z"
|
|
90
|
+
default_action: "pause"
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
**Resolution options**:
|
|
94
|
+
- `proceed` - Continue with the task
|
|
95
|
+
- `skip` - Skip this story and continue
|
|
96
|
+
- `retry` - Retry the failed operation
|
|
97
|
+
- `abort` - Stop the sprint
|
|
98
|
+
|
|
99
|
+
### 5. Stop Conditions
|
|
100
|
+
|
|
101
|
+
The conductor stops when any condition is met:
|
|
102
|
+
|
|
103
|
+
| Condition | Default | Description |
|
|
104
|
+
|-----------|---------|-------------|
|
|
105
|
+
| Max stories | 10 | Maximum stories processed |
|
|
106
|
+
| Max failures | 3 | Consecutive failures threshold |
|
|
107
|
+
| Max runtime | 12h | Maximum total runtime |
|
|
108
|
+
| Stop window | 06:00 | Time-based stop (for overnight) |
|
|
109
|
+
| Critical escalation | - | Pauses on critical issues |
|
|
110
|
+
|
|
111
|
+
## Parallel Processing
|
|
112
|
+
|
|
113
|
+
When `--parallel N` is specified, the ASC processes stories in parallel waves:
|
|
114
|
+
|
|
115
|
+
### How It Works
|
|
116
|
+
|
|
117
|
+
1. **Dependency Graph**: The ASC builds a dependency graph from `blocked_by` relationships
|
|
118
|
+
2. **Wave Processing**: Stories are processed in waves based on dependency satisfaction
|
|
119
|
+
3. **Slot Management**: Up to N concurrent sessions, limited by CPU/memory thresholds
|
|
120
|
+
4. **Sequential Merge**: Git branches are merged sequentially to avoid conflicts
|
|
121
|
+
|
|
122
|
+
```
|
|
123
|
+
Wave 1: [US-001, US-002, US-003] ← Independent stories (no blockers)
|
|
124
|
+
↓ ↓ ↓
|
|
125
|
+
Session Session Session
|
|
126
|
+
↓ ↓ ↓
|
|
127
|
+
Complete Complete Complete
|
|
128
|
+
|
|
129
|
+
Wave 2: [US-004, US-005] ← Depend on US-001/US-002 (now done)
|
|
130
|
+
↓ ↓
|
|
131
|
+
Session Session
|
|
132
|
+
↓ ↓
|
|
133
|
+
Complete Complete
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### Dependency Handling
|
|
137
|
+
|
|
138
|
+
Stories are only scheduled when their dependencies are satisfied:
|
|
139
|
+
|
|
140
|
+
```yaml
|
|
141
|
+
# sprint-status.yaml
|
|
142
|
+
stories:
|
|
143
|
+
US-001:
|
|
144
|
+
status: ready-for-dev
|
|
145
|
+
blocked_by: [] # ✓ Can start immediately
|
|
146
|
+
US-002:
|
|
147
|
+
status: ready-for-dev
|
|
148
|
+
blocked_by: [] # ✓ Can start immediately
|
|
149
|
+
US-003:
|
|
150
|
+
status: ready-for-dev
|
|
151
|
+
blocked_by: [US-001] # ✗ Waits for US-001 completion
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### Resource Limits
|
|
155
|
+
|
|
156
|
+
```yaml
|
|
157
|
+
# ralph-autonomous.yml
|
|
158
|
+
parallel:
|
|
159
|
+
enabled: true
|
|
160
|
+
max_concurrent: 3
|
|
161
|
+
resource_limits:
|
|
162
|
+
cpu_percent: 80 # Don't spawn if CPU > 80%
|
|
163
|
+
mem_percent: 80 # Don't spawn if memory > 80%
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
## Quick Start Examples
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
# Overnight sprint run
|
|
170
|
+
/common:ralph-sprint "Sprint 3" --overnight
|
|
171
|
+
|
|
172
|
+
# Parallel processing with 3 sessions
|
|
173
|
+
/common:ralph-sprint "Sprint 3" --parallel 3
|
|
174
|
+
|
|
175
|
+
# Combined: parallel overnight
|
|
176
|
+
/common:ralph-sprint "Sprint 3" --parallel 3 --overnight
|
|
177
|
+
|
|
178
|
+
# Supervised mode (confirm each story)
|
|
179
|
+
/common:ralph-sprint "Sprint 3" --supervised
|
|
180
|
+
|
|
181
|
+
# Limited run (5 stories, 4 hours)
|
|
182
|
+
/common:ralph-sprint "Sprint 3" --max-stories 5 --timeout 4
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
## Configuration
|
|
186
|
+
|
|
187
|
+
The ASC uses `Tools/Ralph/config/ralph-autonomous.yml`:
|
|
188
|
+
|
|
189
|
+
```yaml
|
|
190
|
+
autonomous:
|
|
191
|
+
enabled: true
|
|
192
|
+
mode: "bounded"
|
|
193
|
+
schedule:
|
|
194
|
+
stop_window: "06:00"
|
|
195
|
+
max_runtime_hours: 12
|
|
196
|
+
limits:
|
|
197
|
+
max_stories_per_session: 10
|
|
198
|
+
max_consecutive_failures: 3
|
|
199
|
+
parallel:
|
|
200
|
+
enabled: false
|
|
201
|
+
max_concurrent: 3
|
|
202
|
+
|
|
203
|
+
recovery:
|
|
204
|
+
enabled: true
|
|
205
|
+
max_attempts: 3
|
|
206
|
+
auto_retry_transient: true
|
|
207
|
+
auto_fix_lint: true
|
|
208
|
+
auto_fix_tests: "retry_tdd"
|
|
209
|
+
|
|
210
|
+
escalation:
|
|
211
|
+
enabled: true
|
|
212
|
+
timeout_hours: 4
|
|
213
|
+
default_action: "skip"
|
|
214
|
+
critical_action: "pause"
|
|
215
|
+
webhook:
|
|
216
|
+
url: ""
|
|
217
|
+
type: "slack"
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
## Output
|
|
221
|
+
|
|
222
|
+
```
|
|
223
|
+
╔════════════════════════════════════════════════════════════╗
|
|
224
|
+
║ Autonomous Sprint Conductor (ASC) ║
|
|
225
|
+
║ Sprint 3 ║
|
|
226
|
+
╚════════════════════════════════════════════════════════════╝
|
|
227
|
+
|
|
228
|
+
ℹ [ASC] Initialized Sprint Conductor
|
|
229
|
+
ℹ [ASC] Session: ASC-20240101-120000-12345
|
|
230
|
+
ℹ [ASC] Mode: bounded
|
|
231
|
+
ℹ [ASC] Max stories: 10
|
|
232
|
+
ℹ [ASC] Max runtime: 12h
|
|
233
|
+
|
|
234
|
+
ℹ [ASC] Processing story: US-001
|
|
235
|
+
ℹ [ASC] Claimed story: US-001
|
|
236
|
+
ℹ [ASC] Spawning Ralph for story: US-001
|
|
237
|
+
✓ [ASC] Story completed: US-001
|
|
238
|
+
ℹ [ASC] Transitioned US-001 to review
|
|
239
|
+
|
|
240
|
+
ℹ [ASC] Processing story: US-002
|
|
241
|
+
⚠ Error classified as Level 1 (recoverable): test_fail
|
|
242
|
+
ℹ Attempting auto-fix for: test_fail
|
|
243
|
+
ℹ TDD retry: extracting failing tests...
|
|
244
|
+
✓ [ASC] Story completed: US-002
|
|
245
|
+
|
|
246
|
+
ℹ [ASC] Processing story: US-003
|
|
247
|
+
⚠ Error classified as Level 3 (blocked): security
|
|
248
|
+
⚠ Escalation created: ESC-1704067200-123 (blocked - security)
|
|
249
|
+
ℹ [ASC] Story escalated: US-003
|
|
250
|
+
|
|
251
|
+
════════════════════════════════════════
|
|
252
|
+
Sprint Conductor Summary
|
|
253
|
+
════════════════════════════════════════
|
|
254
|
+
|
|
255
|
+
Session: ASC-20240101-120000-12345
|
|
256
|
+
Duration: 4h 23m
|
|
257
|
+
|
|
258
|
+
Stories:
|
|
259
|
+
Completed: 7
|
|
260
|
+
Failed: 1
|
|
261
|
+
Skipped: 2
|
|
262
|
+
|
|
263
|
+
Escalations:
|
|
264
|
+
created: 3
|
|
265
|
+
resolved: 2
|
|
266
|
+
|
|
267
|
+
Recovery attempts: 8
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
## Success Metrics
|
|
271
|
+
|
|
272
|
+
| Metric | Current | Target |
|
|
273
|
+
|--------|---------|--------|
|
|
274
|
+
| Human interventions/sprint | ~15 | <5 |
|
|
275
|
+
| Stories completed overnight | 0 | 3-5 |
|
|
276
|
+
| Auto-recovery success rate | N/A | >70% |
|
|
277
|
+
| Time to escalation | N/A | <15 min |
|
|
278
|
+
| Parallel efficiency | N/A | >60% |
|
|
279
|
+
|
|
280
|
+
## Best Practices
|
|
281
|
+
|
|
282
|
+
1. **Start supervised**: Use `--supervised` first to validate behavior
|
|
283
|
+
2. **Set realistic limits**: Don't set max-stories too high initially
|
|
284
|
+
3. **Monitor escalations**: Check `.ralph/escalations/queue/` regularly
|
|
285
|
+
4. **Review metrics**: Analyze `metrics-*.json` after each run
|
|
286
|
+
5. **Configure webhooks**: Set up Slack/Teams notifications for critical issues
|
|
287
|
+
|
|
288
|
+
## Related
|
|
289
|
+
|
|
290
|
+
- `/common:ralph-run` - Single task continuous loop
|
|
291
|
+
- `/project:run-sprint` - Standard sprint execution
|
|
292
|
+
- `/sprint:next-story` - Get next ready story
|
|
293
|
+
- `@ralph-conductor` - Ralph orchestration agent
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Ejecutar el conductor de sprint autonomo para ejecucion overnight/desatendida
|
|
3
|
+
argument-hint: <nombre-sprint> [--overnight|--parallel N|--supervised|--max-stories N]
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Ralph Sprint - Conductor de Sprint Autonomo (ASC)
|
|
7
|
+
|
|
8
|
+
Ejecuta un sprint completo de forma autonoma con minima intervencion humana. El Conductor de Sprint Autonomo (ASC) gestiona la reclamacion de historias, ejecucion, transiciones, recuperacion de errores y escalamiento de problemas bloqueantes.
|
|
9
|
+
|
|
10
|
+
## Argumentos
|
|
11
|
+
|
|
12
|
+
**$ARGUMENTS**
|
|
13
|
+
|
|
14
|
+
- `<nombre-sprint>`: Nombre o ID del sprint a procesar
|
|
15
|
+
- `--overnight`: Modo nocturno (limitado, para a las 6am)
|
|
16
|
+
- `--parallel N`: Procesar hasta N historias en paralelo (defecto: 1)
|
|
17
|
+
- `--supervised`: Pausar antes de cada historia para confirmacion
|
|
18
|
+
- `--max-stories N`: Maximo de historias a procesar (defecto: 10)
|
|
19
|
+
- `--timeout H`: Tiempo maximo de ejecucion en horas (defecto: 12)
|
|
20
|
+
|
|
21
|
+
## Caracteristicas Principales
|
|
22
|
+
|
|
23
|
+
| Caracteristica | Descripcion |
|
|
24
|
+
|----------------|-------------|
|
|
25
|
+
| **Auto-Claim** | Reclama automaticamente la siguiente historia lista |
|
|
26
|
+
| **Auto-Transicion** | Transiciona historias segun estado de completitud |
|
|
27
|
+
| **Motor de Recuperacion** | Auto-recuperacion de errores transitorios/recuperables |
|
|
28
|
+
| **Servicio de Escalamiento** | Cola de problemas bloqueantes para resolucion humana |
|
|
29
|
+
| **Procesamiento Paralelo** | Procesa multiples historias independientes simultaneamente |
|
|
30
|
+
| **Ejecucion Limitada** | Ventanas de tiempo, limites de historias, umbrales de fallos |
|
|
31
|
+
|
|
32
|
+
## Proceso
|
|
33
|
+
|
|
34
|
+
### 1. Inicializacion del Sprint
|
|
35
|
+
|
|
36
|
+
1. **Cargar configuracion del sprint**:
|
|
37
|
+
- Leer metadatos desde `.bmad/sprint-status.yaml`
|
|
38
|
+
- Cargar config autonoma desde `ralph-autonomous.yml`
|
|
39
|
+
- Inicializar motor de recuperacion y servicio de escalamiento
|
|
40
|
+
|
|
41
|
+
2. **Activar modo autonomo**:
|
|
42
|
+
- Configurar circuit breaker en perfil autonomo
|
|
43
|
+
- Activar recuperacion antes de disparo
|
|
44
|
+
- Inicializar gestor paralelo si esta activado
|
|
45
|
+
|
|
46
|
+
### 2. Bucle Principal del Conductor
|
|
47
|
+
|
|
48
|
+
El ASC ejecuta un bucle continuo:
|
|
49
|
+
|
|
50
|
+
1. Verificar condiciones de parada
|
|
51
|
+
2. Obtener siguiente historia lista
|
|
52
|
+
3. Reclamar la historia
|
|
53
|
+
4. Ejecutar con Ralph
|
|
54
|
+
5. Procesar resultado (exito/fallo/escalado)
|
|
55
|
+
6. Transicionar historia
|
|
56
|
+
7. Crear checkpoint
|
|
57
|
+
|
|
58
|
+
### 3. Recuperacion de Errores
|
|
59
|
+
|
|
60
|
+
El Motor de Recuperacion clasifica errores en 4 niveles:
|
|
61
|
+
|
|
62
|
+
| Nivel | Tipo | Accion | Ejemplos |
|
|
63
|
+
|-------|------|--------|----------|
|
|
64
|
+
| 0 | **Transitorio** | Auto-retry con backoff | Timeout, rate limit, red |
|
|
65
|
+
| 1 | **Recuperable** | Auto-fix + retry | Lint, tests, deps, sintaxis |
|
|
66
|
+
| 2 | **Degradado** | Continuar con warning | Docs, gates opcionales |
|
|
67
|
+
| 3 | **Bloqueado** | Escalar a humano | Seguridad, arquitectura |
|
|
68
|
+
|
|
69
|
+
### 4. Gestion de Escalamientos
|
|
70
|
+
|
|
71
|
+
Los problemas bloqueantes se ponen en cola para resolucion humana.
|
|
72
|
+
|
|
73
|
+
**Opciones de resolucion**:
|
|
74
|
+
- `proceed` - Continuar con la tarea
|
|
75
|
+
- `skip` - Saltar esta historia y continuar
|
|
76
|
+
- `retry` - Reintentar la operacion fallida
|
|
77
|
+
- `abort` - Detener el sprint
|
|
78
|
+
|
|
79
|
+
### 5. Condiciones de Parada
|
|
80
|
+
|
|
81
|
+
| Condicion | Defecto | Descripcion |
|
|
82
|
+
|-----------|---------|-------------|
|
|
83
|
+
| Max historias | 10 | Maximo de historias procesadas |
|
|
84
|
+
| Max fallos | 3 | Umbral de fallos consecutivos |
|
|
85
|
+
| Max runtime | 12h | Tiempo maximo total |
|
|
86
|
+
| Ventana parada | 06:00 | Parada por hora (overnight) |
|
|
87
|
+
| Escalamiento critico | - | Pausa en problemas criticos |
|
|
88
|
+
|
|
89
|
+
## Ejemplos Rapidos
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
# Sprint nocturno
|
|
93
|
+
/common:ralph-sprint "Sprint 3" --overnight
|
|
94
|
+
|
|
95
|
+
# Procesamiento paralelo con 3 sesiones
|
|
96
|
+
/common:ralph-sprint "Sprint 3" --parallel 3
|
|
97
|
+
|
|
98
|
+
# Modo supervisado
|
|
99
|
+
/common:ralph-sprint "Sprint 3" --supervised
|
|
100
|
+
|
|
101
|
+
# Ejecucion limitada
|
|
102
|
+
/common:ralph-sprint "Sprint 3" --max-stories 5 --timeout 4
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## Configuracion
|
|
106
|
+
|
|
107
|
+
El ASC usa `Tools/Ralph/config/ralph-autonomous.yml`:
|
|
108
|
+
|
|
109
|
+
```yaml
|
|
110
|
+
autonomous:
|
|
111
|
+
enabled: true
|
|
112
|
+
mode: "bounded"
|
|
113
|
+
schedule:
|
|
114
|
+
stop_window: "06:00"
|
|
115
|
+
max_runtime_hours: 12
|
|
116
|
+
limits:
|
|
117
|
+
max_stories_per_session: 10
|
|
118
|
+
max_consecutive_failures: 3
|
|
119
|
+
parallel:
|
|
120
|
+
enabled: false
|
|
121
|
+
max_concurrent: 3
|
|
122
|
+
|
|
123
|
+
recovery:
|
|
124
|
+
enabled: true
|
|
125
|
+
max_attempts: 3
|
|
126
|
+
auto_fix_lint: true
|
|
127
|
+
auto_fix_tests: "retry_tdd"
|
|
128
|
+
|
|
129
|
+
escalation:
|
|
130
|
+
enabled: true
|
|
131
|
+
timeout_hours: 4
|
|
132
|
+
default_action: "skip"
|
|
133
|
+
critical_action: "pause"
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## Metricas de Exito
|
|
137
|
+
|
|
138
|
+
| Metrica | Actual | Objetivo |
|
|
139
|
+
|---------|--------|----------|
|
|
140
|
+
| Intervenciones humanas/sprint | ~15 | <5 |
|
|
141
|
+
| Historias completadas overnight | 0 | 3-5 |
|
|
142
|
+
| Tasa auto-recuperacion | N/A | >70% |
|
|
143
|
+
| Tiempo hasta escalamiento | N/A | <15 min |
|
|
144
|
+
| Eficiencia paralelizacion | N/A | >60% |
|
|
145
|
+
|
|
146
|
+
## Mejores Practicas
|
|
147
|
+
|
|
148
|
+
1. **Empezar supervisado**: Usar `--supervised` primero
|
|
149
|
+
2. **Limites realistas**: No poner max-stories muy alto inicialmente
|
|
150
|
+
3. **Monitorear escalamientos**: Revisar `.ralph/escalations/queue/`
|
|
151
|
+
4. **Analizar metricas**: Examinar `metrics-*.json` despues de cada run
|
|
152
|
+
5. **Configurar webhooks**: Notificaciones Slack/Teams para problemas criticos
|
|
153
|
+
|
|
154
|
+
## Relacionado
|
|
155
|
+
|
|
156
|
+
- `/common:ralph-run` - Bucle continuo para una tarea
|
|
157
|
+
- `/project:run-sprint` - Ejecucion estandar de sprint
|
|
158
|
+
- `/sprint:next-story` - Obtener siguiente historia lista
|
|
159
|
+
- `@ralph-conductor` - Agente de orquestacion Ralph
|