feat: add in-memory diff cache with TTL and commit-hash invalidation

Adds DiffCache<T> module, extends BranchManager with getHeadCommitHash,
and wires phase-level caching into getPhaseReviewDiff and getFileDiff.
Cache is invalidated in ExecutionOrchestrator after each task merges into
the phase branch, ensuring stale diffs are never served after new commits.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Lukas May
2026-03-06 19:51:04 +01:00
parent 90978d631a
commit 0996073deb
6 changed files with 112 additions and 4 deletions

View File

@@ -48,6 +48,7 @@ function createMocks() {
diffBranches: vi.fn().mockResolvedValue(''),
diffBranchesStat: vi.fn().mockResolvedValue([]),
diffFileSingle: vi.fn().mockResolvedValue(''),
getHeadCommitHash: vi.fn().mockResolvedValue('deadbeef00000000000000000000000000000000'),
deleteBranch: vi.fn(),
branchExists: vi.fn().mockResolvedValue(true),
remoteBranchExists: vi.fn().mockResolvedValue(false),