Conversation
변경 폴의 재빌드가 바뀌지 않은 blob을 다시 `git show`하지 않게 할 캐시. 키가 내용의 해시라 무효화가 없고, 상한(기본 64MB)을 넘으면 오래된 것부터 버린다. 상한보다 큰 항목은 저장하지 않는다. 아직 아무도 쓰지 않는다 — 다음 커밋들이 `getDiffFiles`와 서버에 배선한다. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XAe9zh6siLHSR4nPpqm8QK
blob 캐시가 실패한 `git show`(빈 출력)를 저장하지 않으려면 빈 파일과 실패를 갈라야 한다. `gitRun`이 stdout과 종료 코드를 함께 주고, `gitBytes`는 그 위에서 지금과 같은 동작(종료 코드 무시)을 유지한다. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XAe9zh6siLHSR4nPpqm8QK
`git diff --name-status -z`를 `git diff --raw -z --no-abbrev`로 바꾼다. 같은 한 번의 호출에 파일마다 old/new blob OID가 실려 온다 — 다음 커밋의 blob 캐시가 이것을 키로 쓴다. 상태 매핑·경로·끝의 `--`는 그대로라 동작은 같다. `--no-abbrev`가 계약이다: `--full-index`로는 7자 약어가 나온다(실측). 없는 쪽 OID(0)는 null로 둔다. `buildFile`은 필드가 늘어 spec 객체를 받는다. 파서 테스트의 입력은 git 2.55의 실제 출력(A·D·M·R·T, SHA-256)을 옮긴 것이다. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XAe9zh6siLHSR4nPpqm8QK
`getDiffFiles(repo, opts, blobs)`가 선택 인자로 blob 캐시를 받는다. old 쪽과 head 모드의 new 쪽은 `--raw`가 준 OID로 캐시를 먼저 보고, 없으면 지금과 같은 `git show`로 읽는다. 워킹트리 new 쪽은 캐시하지 않는다(디스크가 진실). - 키는 전체 OID — 이름으로 잡으면 커밋 직후 옛 내용을 낸다. - `git show`의 종료 코드가 0일 때만 저장한다. 워킹트리 비교에선 old blob이 없으면 `git diff --raw`가 먼저 죽으므로(실측), 이 가드가 실제로 지키는 곳은 목록이 blob을 읽지 않는 head 모드다 — 테스트도 그 모드에서 재현한다. - OID는 캐시 키로만 쓴다. old 쪽을 읽을지는 지금처럼 상태가 정한다. 회귀망 `diff-blob-cache.test.ts` 4종. 이름 키 뮤테이션과 실패 저장 뮤테이션을 각각 정확히 한 테스트가 잡는다. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XAe9zh6siLHSR4nPpqm8QK
`createHandler`가 `diffCache` 옆에 blob 캐시를 하나 만들어 `/api/diff`의 두 `getDiffFiles` 호출(워킹트리 모드·base 모드)에 넘긴다. prewarm과 `/api/diff`가 공유한다. `startDiffServer`에 테스트용 `blobCache` 이음새를 둔다 (`flightTimeoutMs`·`cwdDeps`와 같은 종류). 배선 테스트는 두 모드를 따로 찌른다 — 한 모드만 보면 다른 호출에서 캐시를 빼도 초록이다. 호출을 하나씩 빼는 뮤테이션으로 각각 한 테스트만 죽는 것을 확인했다. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XAe9zh6siLHSR4nPpqm8QK
키는 전체 OID(`--no-abbrev`, 이름 금지), 종료 코드 0만 저장(가드가 실제로 지키는 곳은 목록이 blob을 읽지 않는 head 모드 — 워킹트리 비교는 old blob이 없으면 목록이 먼저 죽는다), OID는 키로만, 워킹트리 new 쪽은 캐시 안 함. 회귀망과 각 테스트가 잡는 뮤테이션도 함께 적는다. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XAe9zh6siLHSR4nPpqm8QK
Owner
Author
|
A/B 종료 — 같은 시각에 나란히 돌린 4라운드에서 #79( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR #79의
worker-highlight.e2e.ts실패가 #78(git 호출을Bun.spawn으로)과 관련 있는지 가르는 대조군입니다. #79의 head(4fc35df)에서 다섯 호출만$로 되돌렸습니다. 같은 시간대에 #79와 나란히 e2e를 여러 번 돌려 비교한 뒤 닫습니다.🤖 Generated with Claude Code
https://claude.ai/code/session_01XAe9zh6siLHSR4nPpqm8QK