Эх сурвалжийг харах

chore: translate ExecutionBalanceEvaluator and test files from Spanish to English

- Translate all code comments and documentation in execution-balance-evaluator.ts
- Translate test descriptions and prompts in execution-balance-positive.yaml
- Translate test descriptions and prompts in execution-balance-negative.yaml

This ensures consistency with the rest of the English codebase as requested in PR review.
Alexander Daza 8 сар өмнө
parent
commit
f5bab1bdfc

+ 6 - 6
evals/agents/openagent/tests/10-execution-balance/execution-balance-negative.yaml

@@ -1,17 +1,17 @@
 id: execution-balance-negative-001
-name: Execution Balance - Ejecución sin lectura
+name: Execution Balance - Execution without reading
 description: |
-  Test negativo que intenta forzar ejecución (write) sin operaciones de lectura previas.
-  Puede fallar si el agente decide leer de forma proactiva.
-  Si el agente realiza lectura previa, el test marcará ausencia de la violación esperada.
+  Negative test that attempts to force execution (write) without prior read operations.
+  May fail if the agent decides to read proactively.
+  If the agent performs a prior read, the test will mark the absence of expected violation.
 category: developer
 agent: openagent
 
 prompts:
   - text: |
-      Crea directamente un archivo en evals/test_tmp/execution-balance-fail.txt con el contenido "sin lectura previa". Hazlo de forma directa.
+      Create a file directly in evals/test_tmp/execution-balance-fail.txt with the content "without prior reading". Do it directly.
   - text: |
-      Aprobar.
+      Approve.
     delayMs: 1500
 
 behavior:

+ 6 - 6
evals/agents/openagent/tests/10-execution-balance/execution-balance-positive.yaml

@@ -1,19 +1,19 @@
 id: execution-balance-positive-001
-name: Execution Balance - Lectura antes de ejecución
+name: Execution Balance - Read before execution
 description: |
-  Verifica que el agente realiza al menos una operación de lectura antes de ejecutar una acción de escritura.
-  Esperamos que NO viole la regla execution-balance.
+  Verifies that the agent performs at least one read operation before executing a write action.
+  We expect NO violations of the execution-balance rule.
 category: developer
 agent: openagent
 
 prompts:
   - text: |
-      Primero inspecciona el directorio evals/test_tmp/ para entender su contenido antes de crear o modificar archivos.
+      First inspect the evals/test_tmp/ directory to understand its contents before creating or modifying files.
   - text: |
-      Sí, procede con el plan.
+      Yes, proceed with the plan.
     delayMs: 2000
   - text: |
-      Crea un archivo en evals/test_tmp/execution-balance-pass.txt con el contenido "balance ok".
+      Create a file in evals/test_tmp/execution-balance-pass.txt with the content "balance ok".
 
 behavior:
   mustUseTools: [write]

+ 17 - 17
evals/framework/src/evaluators/execution-balance-evaluator.ts

@@ -1,13 +1,13 @@
 /**
- * ExecutionBalanceEvaluator - Evalúa equilibrio y orden entre lectura y ejecución.
+ * ExecutionBalanceEvaluator - Evaluates balance and order between read and execution operations.
  *
- * Reglas:
- * 1. Debe existir al menos una operación de lectura (read/glob/grep/list) antes de la primera herramienta de ejecución (bash/write/edit/task).
- * 2. La relación lecturas:ejecuciones debe ser >= 1 cuando hay ejecuciones (favorece exploración antes de modificar).
+ * Rules:
+ * 1. At least one read operation (read/glob/grep/list) must occur before the first execution tool (bash/write/edit/task).
+ * 2. The read-to-execution ratio must be >= 1 when there are executions (promotes exploration before modification).
  *
- * Violaciones:
- * - execution-before-read (error): Se ejecuta una herramienta de modificación sin ninguna lectura previa.
- * - insufficient-read (warning): Menos lecturas que ejecuciones totales.
+ * Violations:
+ * - execution-before-read (error): A modification tool is executed without any prior read operations.
+ * - insufficient-read (warning): Fewer reads than total executions.
  */
 
 import { BaseEvaluator } from './base-evaluator.js';
@@ -22,7 +22,7 @@ import {
 
 export class ExecutionBalanceEvaluator extends BaseEvaluator {
   name = 'execution-balance';
-  description = 'Verifica que se lea antes de ejecutar y mantiene un ratio saludable lectura/ejecución';
+  description = 'Verifies that reads occur before executions and maintains a healthy read/execution ratio';
 
   async evaluate(timeline: TimelineEvent[], sessionInfo: SessionInfo): Promise<EvaluationResult> {
     const checks: Check[] = [];
@@ -35,7 +35,7 @@ export class ExecutionBalanceEvaluator extends BaseEvaluator {
     const firstExec = execEvents.sort((a,b)=>a.timestamp-b.timestamp)[0];
     const firstRead = readEvents.sort((a,b)=>a.timestamp-b.timestamp)[0];
 
-    // Check 1: Lectura antes de la primera ejecución
+    // Check 1: Read before first execution
     const readBeforeExec = !firstExec || (firstRead && firstRead.timestamp < firstExec.timestamp);
     checks.push({
       name: 'read-before-first-exec',
@@ -44,7 +44,7 @@ export class ExecutionBalanceEvaluator extends BaseEvaluator {
       evidence: [
         this.createEvidence(
           'ordering',
-          'Orden de primera lectura y primera ejecución',
+          'Order of first read and first execution',
           {
             firstReadTs: firstRead?.timestamp,
             firstExecTs: firstExec?.timestamp,
@@ -60,7 +60,7 @@ export class ExecutionBalanceEvaluator extends BaseEvaluator {
         this.createViolation(
           'execution-before-read',
           'error',
-          'Se ejecutó una herramienta de modificación sin lectura previa',
+          'A modification tool was executed without prior read operations',
           firstExec.timestamp,
           {
             tool: firstExec.data?.tool,
@@ -70,7 +70,7 @@ export class ExecutionBalanceEvaluator extends BaseEvaluator {
       );
     }
 
-    // Check 2: Ratio lecturas:ejecuciones >= 1 (solo si hay ejecuciones)
+    // Check 2: Read/execution ratio >= 1 (only if there are executions)
     const readCount = readEvents.length;
     const execCount = execEvents.length;
     const ratio = execCount === 0 ? Infinity : readCount / execCount;
@@ -83,31 +83,31 @@ export class ExecutionBalanceEvaluator extends BaseEvaluator {
       evidence: [
         this.createEvidence(
           'ratio-metrics',
-          'Métricas de relación lectura/ejecución',
+          'Read/execution ratio metrics',
           { readCount, execCount, ratio }
         )
       ]
     });
 
     if (!ratioPass && execCount > 0) {
-      // Usamos warning para incentivar mejora sin bloquear completamente
+      // We use warning to encourage improvement without completely blocking
       const firstBad = execEvents[0];
       violations.push(
         this.createViolation(
           'insufficient-read',
           'warning',
-          `Ratio lectura/ejecución < 1 (${ratio.toFixed(2)})`,
+          `Read/execution ratio < 1 (${ratio.toFixed(2)})`,
           firstBad.timestamp,
           { readCount, execCount, ratio }
         )
       );
     }
 
-    // Evidencia contextual
+    // Contextual evidence
     evidence.push(
       this.createEvidence(
         'session-summary',
-        'Resumen básico de sesión para balance de ejecución',
+        'Basic session summary for execution balance',
         {
           title: sessionInfo.title,
           readCount,