MCPcopy Create free account
hub / github.com/backnotprop/plannotator / getSemanticDiff

Function getSemanticDiff

packages/server/review.ts:468–489  ·  view source on GitHub ↗
(url: URL)

Source from the content-addressed store, hash-verified

466 };
467
468 const getSemanticDiff = async (url: URL): Promise<SemanticDiffResponse> => {
469 // Semantic diff reads real files — wait out the checkout warmup in PR mode.
470 if (isPRMode && options.worktreePool) await ensurePRLocalCwd();
471 const cwd = resolveSemanticDiffCwd();
472 const fileExts = semanticDiffFileExtsFromSearchParams(url.searchParams);
473 const cacheKey = semanticDiffCacheKey({ rawPatch: currentPatch, cwd, fileExts });
474 const cached = semanticDiffCache.get(cacheKey, currentPatch);
475 if (cached) return cached;
476
477 const result = await runSemanticDiff(
478 { rawPatch: currentPatch, cwd, fileExts },
479 createSemanticDiffRuntime(cwd),
480 );
481 if (result.status === "ok") {
482 semanticDiffCache.set(cacheKey, currentPatch, result);
483 } else if (result.status === "error") {
484 // Cooldown-memoized: request rate (file badges remount on scroll) must
485 // not drive sem execution rate when it's failing.
486 semanticDiffCache.setFailure(cacheKey, currentPatch, result);
487 }
488 return result;
489 };
490
491 const agentJobs = createAgentJobHandler({
492 mode: "review",

Callers 1

fetchFunction · 0.70

Calls 9

semanticDiffCacheKeyFunction · 0.90
runSemanticDiffFunction · 0.90
ensurePRLocalCwdFunction · 0.85
setFailureMethod · 0.80
resolveSemanticDiffCwdFunction · 0.70
getMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected