zugzbot-sdd 1.5.28 → 1.5.29

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.
@@ -185,18 +185,7 @@ export default tool({
185
185
  report.push(`⚠️ No se pudo restablecer el lockfile: ${e.message}`);
186
186
  }
187
187
  }
188
- // 6. Confirmación Git Atómica (usa temp commit msg, antes de archivar)
189
- if (fs.existsSync(path.join(projectRoot, ".git"))) {
190
- try {
191
- execSync("git add .", { cwd: projectRoot, stdio: "ignore" });
192
- execSync(`git commit -F "${tempCommitMsgPath}"`, { cwd: projectRoot, stdio: "ignore" });
193
- report.push(`✓ Commit de Git ejecutado usando el mensaje semántico`);
194
- }
195
- catch (e) {
196
- report.push(`⚠️ Git Commit falló o no había cambios pendientes de código: ${e.message}`);
197
- }
198
- }
199
- // 8. Archivar la carpeta físicamente (DESPUÉS del commit)
188
+ // 6. Archivar la carpeta físicamente (ANTES del commit para que quede registrado de forma atómica)
200
189
  const archiveDir = path.join(projectRoot, ".openspec/changes/archive", `${dateStr}-${args.changeName}`);
201
190
  try {
202
191
  if (fs.existsSync(archiveDir)) {
@@ -209,7 +198,18 @@ export default tool({
209
198
  catch (e) {
210
199
  return `[SDD Archive Error] Error crítico archivando carpetas: ${e.message}`;
211
200
  }
212
- // 9. Limpiar archivo temporal de commit message
201
+ // 7. Confirmación Git Atómica (incluye la carpeta archivada y la eliminación de la activa)
202
+ if (fs.existsSync(path.join(projectRoot, ".git"))) {
203
+ try {
204
+ execSync("git add .", { cwd: projectRoot, stdio: "ignore" });
205
+ execSync(`git commit -F "${tempCommitMsgPath}"`, { cwd: projectRoot, stdio: "ignore" });
206
+ report.push(`✓ Commit de Git ejecutado usando el mensaje semántico (incluye archivos archivados)`);
207
+ }
208
+ catch (e) {
209
+ report.push(`⚠️ Git Commit falló o no había cambios pendientes de código: ${e.message}`);
210
+ }
211
+ }
212
+ // 8. Limpiar archivo temporal de commit message
213
213
  try {
214
214
  if (fs.existsSync(tempCommitMsgPath)) {
215
215
  fs.unlinkSync(tempCommitMsgPath);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zugzbot-sdd",
3
- "version": "1.5.28",
3
+ "version": "1.5.29",
4
4
  "description": "Zugzbot SDD Swarm - Spec-Driven Development Harness for OpenCode",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -184,18 +184,7 @@ export default tool({
184
184
  }
185
185
  }
186
186
 
187
- // 6. Confirmación Git Atómica (usa temp commit msg, antes de archivar)
188
- if (fs.existsSync(path.join(projectRoot, ".git"))) {
189
- try {
190
- execSync("git add .", { cwd: projectRoot, stdio: "ignore" })
191
- execSync(`git commit -F "${tempCommitMsgPath}"`, { cwd: projectRoot, stdio: "ignore" })
192
- report.push(`✓ Commit de Git ejecutado usando el mensaje semántico`)
193
- } catch (e: any) {
194
- report.push(`⚠️ Git Commit falló o no había cambios pendientes de código: ${e.message}`)
195
- }
196
- }
197
-
198
- // 8. Archivar la carpeta físicamente (DESPUÉS del commit)
187
+ // 6. Archivar la carpeta físicamente (ANTES del commit para que quede registrado de forma atómica)
199
188
  const archiveDir = path.join(projectRoot, ".openspec/changes/archive", `${dateStr}-${args.changeName}`)
200
189
  try {
201
190
  if (fs.existsSync(archiveDir)) {
@@ -208,7 +197,18 @@ export default tool({
208
197
  return `[SDD Archive Error] Error crítico archivando carpetas: ${e.message}`
209
198
  }
210
199
 
211
- // 9. Limpiar archivo temporal de commit message
200
+ // 7. Confirmación Git Atómica (incluye la carpeta archivada y la eliminación de la activa)
201
+ if (fs.existsSync(path.join(projectRoot, ".git"))) {
202
+ try {
203
+ execSync("git add .", { cwd: projectRoot, stdio: "ignore" })
204
+ execSync(`git commit -F "${tempCommitMsgPath}"`, { cwd: projectRoot, stdio: "ignore" })
205
+ report.push(`✓ Commit de Git ejecutado usando el mensaje semántico (incluye archivos archivados)`)
206
+ } catch (e: any) {
207
+ report.push(`⚠️ Git Commit falló o no había cambios pendientes de código: ${e.message}`)
208
+ }
209
+ }
210
+
211
+ // 8. Limpiar archivo temporal de commit message
212
212
  try {
213
213
  if (fs.existsSync(tempCommitMsgPath)) {
214
214
  fs.unlinkSync(tempCommitMsgPath)