agent-rev 0.5.32 → 0.5.33
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/dist/core/engine.js +34 -4
- package/package.json +1 -1
package/dist/core/engine.js
CHANGED
|
@@ -1043,6 +1043,31 @@ REGLA: Al terminar, reporta todo lo que encontraste de forma clara y estructurad
|
|
|
1043
1043
|
const taskId = await this.generateTaskId(task, featureId);
|
|
1044
1044
|
const taskDir = path.join(this.projectDir, '.agent', 'tasks', taskId);
|
|
1045
1045
|
log.phase(1, 'Planificacion', this.config.roles.orchestrator.cli, this.config.roles.orchestrator.model);
|
|
1046
|
+
// VERIFICAR SI YA EXISTE UN PLAN PARA ESTA TAREA
|
|
1047
|
+
const existingPlanPath = path.join(taskDir, 'plan.json');
|
|
1048
|
+
if (await fileExists(existingPlanPath)) {
|
|
1049
|
+
const existingPlan = await readJson(existingPlanPath);
|
|
1050
|
+
console.log(chalk.yellow('\n ⚠️ Ya existe un plan para esta tarea:'));
|
|
1051
|
+
console.log(chalk.dim(` Descripción: ${existingPlan.description?.slice(0, 100) || 'N/A'}`));
|
|
1052
|
+
console.log(chalk.dim(` Steps: ${existingPlan.steps?.length || 0}`));
|
|
1053
|
+
const action = await ask('\n ¿Qué querés hacer? (v=ver plan completo / r=regenerar / m=mantener y continuar): ', this.rl);
|
|
1054
|
+
if (action.toLowerCase() === 'v') {
|
|
1055
|
+
console.log('');
|
|
1056
|
+
console.log(chalk.cyan(' === plan.json ==='));
|
|
1057
|
+
console.log(chalk.white(JSON.stringify(existingPlan, null, 2).slice(0, 2000)));
|
|
1058
|
+
console.log(chalk.cyan(' ================='));
|
|
1059
|
+
const retry = await ask(' ¿Regenerar igual? (y/n): ', this.rl);
|
|
1060
|
+
if (retry.toLowerCase() !== 'y') {
|
|
1061
|
+
log.info('Usando plan existente.');
|
|
1062
|
+
return { taskId, plan: existingPlan };
|
|
1063
|
+
}
|
|
1064
|
+
}
|
|
1065
|
+
else if (action.toLowerCase() === 'm') {
|
|
1066
|
+
log.info('Usando plan existente.');
|
|
1067
|
+
return { taskId, plan: existingPlan };
|
|
1068
|
+
}
|
|
1069
|
+
// Si es 'r', continúa generando nuevo plan
|
|
1070
|
+
}
|
|
1046
1071
|
const context = await this.buildOrchestratorContext();
|
|
1047
1072
|
let specContent = '';
|
|
1048
1073
|
if (specPath && await fileExists(specPath)) {
|
|
@@ -1060,10 +1085,15 @@ ${context}
|
|
|
1060
1085
|
INSTRUCCIONES CRÍTICAS:
|
|
1061
1086
|
1. Si hay SPEC.MD, ESE ES EL DOCUMENTO PRIMARIO — define completamente la tarea. Los archivos raw son solo contexto histórico, NO los uses para definir la implementación.
|
|
1062
1087
|
2. Ignorá cualquier información que NO tenga relación directa con la tarea del spec.md (ej: listas de modelos, ejemplos genéricos, etc.).
|
|
1063
|
-
3.
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1088
|
+
3. **GENERÁ STEPS DE IMPLEMENTACIÓN CONCRETOS** — NO steps sobre "leer", "analizar", "identificar". El implementor ya sabe leer.
|
|
1089
|
+
- ❌ MAL: "Leer spec.md para identificar requerimientos"
|
|
1090
|
+
- ❌ MAL: "Analizar archivos raw como contexto"
|
|
1091
|
+
- ✅ BIEN: "Crear script clock.sh con formato HH:MM:SS, sleep 1, trap SIGINT"
|
|
1092
|
+
- ✅ BIEN: "Hacer ejecutable el script con chmod +x"
|
|
1093
|
+
4. Cada step debe tener una descripción de **ACCIÓN** (crear, modificar, instalar, configurar) y los archivos específicos que se van a crear/modificar.
|
|
1094
|
+
5. Si el spec.md dice "script que muestra la hora", los steps son: (1) crear el script, (2) hacerlo ejecutable. No más.
|
|
1095
|
+
6. Definí acceptance_criteria medibles leyendo archivos.
|
|
1096
|
+
7. Responde SOLO con este JSON exacto, sin texto adicional:
|
|
1067
1097
|
|
|
1068
1098
|
{"plan":{"task_id":"${taskId}","description":"${task}","steps":[{"num":1,"description":"descripcion concreta del paso","files":["archivo/a/crear.ts"],"status":"pending"}],"acceptance_criteria":["criterio verificable"],"deliberation":{"needed":false,"question":""}}}`;
|
|
1069
1099
|
const res = await this.runWithFallback('orchestrator', prompt, 'Planificacion');
|