Implement the following plan: Fix: Impact Evaluation Shows Local Path Instead of…
- User
Implement the following plan:
Fix: Impact Evaluation Shows Local Path Instead of Original Repo URL
Context
When a user runs "Evaluate Impact" from a remediation report, the resulting evaluation report displays a local temporary directory path (e.g.,
/tmp/clone-abc123/) as the repository URL instead of the original repository URL.This happens because the remediation route correctly clones the original repo and applies the git patch, but when submitting the evaluation job, it omits
repositoryUrlfrom the job request. The database layer then falls back tolocalPath(the temp dir) when norepositoryUrlis provided.Root Cause
File:
src/api/routes/remediation.ts, lines 611–619typescriptconst jobId = await this.jobManager.submitJob({ localPath: cloneResult.path, // ← temp dir path, e.g. /tmp/clone-abc123/ options: { selectedEvaluators: parentEvaluatorIds, }, _cleanupFn: cloneResult.cleanup, _parentEvaluationId: remediation.evaluationId, _sourceRemediationId: remediationId, // ← repositoryUrl is missing! });File:
src/api/db/evaluation-repository.ts, line 134typescript$repositoryUrl: request.repositoryUrl || request.localPath || "unknown", // When repositoryUrl is undefined → falls back to localPath (temp dir)The variable
repoUrl(the original repo URL used for cloning) is already in scope at line 547 but is not forwarded tosubmitJob.Fix
Single change in
src/api/routes/remediation.ts: AddrepositoryUrl: repoUrlto thesubmitJobcall.typescript Assistant
The indentation uses tabs. Let me try the edit with explicit tab characters:
Assistant
The change is applied. Now let me run the tests:
Assistant
All 1309 tests pass. The fix is in place.
Added
repositoryUrl: repoUrlto thesubmitJobcall insrc/api/routes/remediation.ts:613. Now when "Evaluate Impact" is triggered from a remediation report, the resulting evaluation will correctly show the original GitHub URL instead of the temp clone directory path.