agent-mp 0.5.28 → 0.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.
@@ -415,11 +415,15 @@ MODO SPEC — Feature cargada: "${activeFeatureId}"
415
415
  Los archivos raw YA ESTÁN en el CONTEXTO DEL PROYECTO arriba.
416
416
 
417
417
  REGLAS CRÍTICAS:
418
- 1. ANTES DE ESCRIBIR CUALQUIER COSA: leé completo cada archivo raw del contexto.
419
- 2. NO preguntes sobre información que ya está en los archivos raw. Si el lenguaje, stack, objetivo, contexto o requisitos están en los archivos, USÁ ESA INFORMACIÓN directamente.
420
- 3. Solo hacé preguntas sobre información que GENUINAMENTE falta y que no podés inferir de los archivos.
421
- 4. Si los archivos ya tienen suficiente información para entender el objetivo, NO hagas preguntas generá el spec.md directamente.
422
- 5. Cuando tengas todo claro (o si los archivos ya tienen suficiente info), generá el spec.md con este formato EXACTO:
418
+ 1. ANTES DE ESCRIBIR CUALQUIER COSA: leé completo el CONTEXTO DEL PROYECTO, incluyendo la sección "TAREA EXISTENTE" si está presente.
419
+ 2. SI EXISTE "TAREA EXISTENTE" en el contexto:
420
+ - Si hay SPEC.MD EXISTENTE: NO lo regeneres. Usalo como referencia.
421
+ - Si hay RESULTADO PREVIO: FAIL: informá al usuario qué falló y preguntá si quiere corregir eso específico.
422
+ - Si ya hay plan.json: NO generes otro spec la tarea ya está definida.
423
+ 3. NO preguntes sobre información que ya está en los archivos raw o en TAREA EXISTENTE.
424
+ 4. Solo hacé preguntas sobre información que GENUINAMENTE falta y que no podés inferir del contexto.
425
+ 5. Si los archivos ya tienen suficiente información para entender el objetivo, NO hagas preguntas — usá el spec existente.
426
+ 6. Cuando tengas todo claro (o si ya hay spec), generá el spec.md SOLO si NO existe uno previo:
423
427
 
424
428
  === SPEC.MD ===
425
429
  # Feature: ${activeFeatureId}
@@ -440,7 +444,7 @@ REGLAS CRÍTICAS:
440
444
  [consideraciones de implementación]
441
445
  === END SPEC.MD ===
442
446
 
443
- 6. Cuando el spec esté aprobado, escribí EXACTAMENTE al final: ${READY_SENTINEL}` : `
447
+ 7. Cuando el spec esté aprobado (o si ya existe), escribí EXACTAMENTE al final: ${READY_SENTINEL}` : `
444
448
  MODO TAREA LIBRE — No se especificó feature todavía.
445
449
  ${featureListBlock}
446
450
  REGLAS:
@@ -463,8 +467,10 @@ ${conversationHistory}
463
467
 
464
468
  INSTRUCCIONES GENERALES:
465
469
  - Hablá en forma NATURAL, como un compañero de equipo experimentado.
466
- - ANTES DE RESPONDER: leé todo el CONTEXTO DEL PROYECTO y los archivos raw de la feature. Si algo ya está documentado ahí, NO lo preguntes.
467
- - NO preguntés cosas que ya están respondidas en los archivos raw o en la conversación.
470
+ - ANTES DE RESPONDER: leé todo el CONTEXTO DEL PROYECTO, incluyendo "TAREA EXISTENTE" si está presente.
471
+ - Si hay una TAREA EXISTENTE con RESULTADO PREVIO: FAIL, informá al usuario qué falló y preguntá si quiere corregir eso específico.
472
+ - Si ya hay SPEC.MD o plan.json para la tarea, NO los regeneres — usá los existentes.
473
+ - NO preguntés cosas que ya están respondidas en los archivos raw, TAREA EXISTENTE o la conversación.
468
474
  - Hacé como máximo UNA pregunta por turno.
469
475
  - NO uses JSON, hablá normalmente.
470
476
  - Sé directo y eficiente — respetá el tiempo del programador.${specInstructions}`;
@@ -981,6 +987,41 @@ REGLA: Al terminar, reporta todo lo que encontraste de forma clara y estructurad
981
987
  ctx += `--- END FEATURE ---\n`;
982
988
  }
983
989
  }
990
+ // VERIFICAR SI EXISTE TAREA PARA ESTA FEATURE — incluir estado y resultado previo
991
+ const taskDir = path.join(this.projectDir, '.agent', 'tasks', featureId);
992
+ if (await fileExists(taskDir)) {
993
+ ctx += `\n\n--- TAREA EXISTENTE: ${featureId} ---\n`;
994
+ // Leer plan.json si existe
995
+ const planPath = path.join(taskDir, 'plan.json');
996
+ if (await fileExists(planPath)) {
997
+ const plan = await readJson(planPath);
998
+ ctx += `\nPLAN EXISTENTE:\n- Descripción: ${plan.description || 'N/A'}\n- Steps: ${plan.steps?.length || 0}\n`;
999
+ }
1000
+ // Leer progress.json si existe
1001
+ const progressPath = path.join(taskDir, 'progress.json');
1002
+ if (await fileExists(progressPath)) {
1003
+ const progress = await readJson(progressPath);
1004
+ ctx += `- Estado: ${progress.status || 'unknown'}\n`;
1005
+ }
1006
+ // Leer result.md si existe — ESTO ES CRÍTICO PARA RE-INTENTOS
1007
+ const resultPath = path.join(taskDir, 'result.md');
1008
+ if (await fileExists(resultPath)) {
1009
+ const result = await readFile(resultPath);
1010
+ const verdict = result.includes('PASS') || result.includes('✅') ? 'PASS' : 'FAIL';
1011
+ ctx += `- RESULTADO PREVIO: ${verdict}\n`;
1012
+ if (verdict === 'FAIL') {
1013
+ ctx += `\n⚠️ ESTA TAREA YA FALLÓ ANTES. Razones del FAIL:\n${result.slice(0, 1500)}\n`;
1014
+ ctx += `\nIMPORTANTE: Si el usuario pide re-implementar, debés corregir ESPECÍFICAMENTE los puntos marcados como FAIL.\n`;
1015
+ }
1016
+ }
1017
+ // Leer spec.md si existe
1018
+ const specPath = path.join(this.projectDir, '.agent', 'docs', featureId, 'spec.md');
1019
+ if (await fileExists(specPath)) {
1020
+ const spec = await readFile(specPath);
1021
+ ctx += `\n--- SPEC.MD EXISTENTE (usar como referencia, NO regenerar) ---\n${spec.slice(0, 2000)}\n`;
1022
+ }
1023
+ ctx += `--- END TAREA ---\n`;
1024
+ }
984
1025
  }
985
1026
  return ctx;
986
1027
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-mp",
3
- "version": "0.5.28",
3
+ "version": "0.5.29",
4
4
  "description": "Deterministic multi-agent CLI orchestrator — plan, code, review",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",