Skip to content

Commit 77040cb

Browse files
rubenmarcusclaude
andcommitted
fix: scope test skip to batch-auto and preserve .ralph config
Address reviewer feedback: - Codex P1: only skip test validation in batch-auto mode (not fix command) - Codex P2: clean only transient .ralph files, preserve config.yaml Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 5707243 commit 77040cb

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

src/loop/executor.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -489,9 +489,11 @@ export async function runLoop(options: LoopOptions): Promise<LoopResult> {
489489
: null;
490490

491491
// Detect validation commands if validation is enabled
492-
// In auto mode, skip test commands — only run build/lint to avoid loops on pre-existing test failures
492+
// In batch-auto mode, skip test commands — only run build/lint to avoid loops on pre-existing test failures
493+
// Note: fixCommand also sets auto=true but always sets fixMode, so we use that to distinguish
493494
const allValidationCommands = options.validate ? detectValidationCommands(options.cwd) : [];
494-
const validationCommands = options.auto
495+
const isBatchAuto = options.auto && !options.fixMode;
496+
const validationCommands = isBatchAuto
495497
? allValidationCommands.filter((cmd) => cmd.name !== 'test')
496498
: allValidationCommands;
497499

src/loop/task-executor.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,15 @@ export async function executeTaskBatch(options: TaskExecutionOptions): Promise<T
103103
};
104104

105105
try {
106-
// Clean .ralph/ directory between tasks to avoid stale context
106+
// Clean transient .ralph/ files between tasks to avoid stale context
107+
// Preserve durable config (config.yaml) written by ralph-starter init
107108
const ralphDir = join(cwd, '.ralph');
108109
if (existsSync(ralphDir)) {
109-
rmSync(ralphDir, { recursive: true, force: true });
110+
const transientFiles = ['context.md', 'progress.md', 'acceptance-criteria.md', 'plan.md'];
111+
for (const file of transientFiles) {
112+
const fp = join(ralphDir, file);
113+
if (existsSync(fp)) rmSync(fp);
114+
}
110115
}
111116

112117
// Notify start

0 commit comments

Comments
 (0)