Implement the following plan: Bug Fix: "Evaluate Impact" Evaluates Original Files…
- User
Implement the following plan:
Bug Fix: "Evaluate Impact" Evaluates Original Files Instead of Patched Files
Context
When clicking "Evaluate Impact" after a remediation, the user expects the evaluation to run on the post-remediation state (patched files). Instead, the new evaluation runs on the original unpatched repository, so issues that were fixed still appear as unfixed. This explains why evaluation
aca7b721still flagged "Conflicting AGENTS.md and CLAUDE.md files" even though the remediation had correctly setCLAUDE.md = @AGENTS.md.Root Cause
Two-part bug:
Part 1 —
remediation.tspasses bothrepositoryUrlANDlocalPathIn
src/api/routes/remediation.ts(theevaluateImpactmethod, ~line 611):typescriptconst jobId = await this.jobManager.submitJob({ localPath: cloneResult.path, // patched clone ← correct repositoryUrl: repoUrl, // original repo URL ← should NOT be here ... });Part 2 —
engine.tsprioritizesrepositoryUrloverlocalPathIn
src/shared/evaluation/engine.ts(~line 680):typescriptif (request.repositoryUrl) { // Clones fresh from original repo ← takes this branch workingDir = cloneResult.path; } else if (request.localPath) { workingDir = resolve(request.localPath); // ← never reached }When both are provided,
repositoryUrlwins and the engine clones fresh from the original repository, discarding the patched clone entirely.Fix
Single-file change in
src/api/routes/remediation.ts: removerepositoryUrlfrom thesubmitJobcall insideevaluateImpact.File:
src/api/routes/remediation.tsChange: RemoverepositoryUrl: repoUrlfrom the job submission inevaluateImpact.The alone is sufficient — it points to the already-cloned, already-patched directory. The engine's branch will then be taken, evaluating the correct patched state.
Assistant
All 1309 tests pass. The fix is a single-line removal from
src/api/routes/remediation.ts:613— droppingrepositoryUrl: repoUrlfrom thesubmitJobcall inevaluateImpact. Now when "Evaluate Impact" is triggered, the engine receives onlylocalPath(the already-patched clone directory) and evaluates the post-remediation state instead of re-cloning the original repository.