Skip to content

64 KiB를 넘는 파일의 apply-patch (ADR-0056) - #107

Merged
SonAIengine merged 1 commit into
mainfrom
feat/large-file-patch
Oct 25, 2026
Merged

SonAIengine merged 1 commit into
mainfrom
feat/large-file-patch

Conversation

@SonAIengine

Copy link
Copy Markdown
Contributor

문제

75 KB, 113 KB 소스 파일의 한 줄 수정 요청이 too_large로 끝났다. apply-patch는 대상 파일을 64 KiB까지만 읽었고, 큰 파일은 expectedDigest로 쓸 파일 digest를 얻을 방법이 없었다. read-text-lines의 digest는 출력에 대한 digest다.

변경 (범용, 사례 전용 규칙 없음)

  • xgeny.fs/read-text-lines 2.0.0: 출력에 fileDigest(파일 전체 SHA-256)를 더했다.
  • xgeny.fs/apply-patch 2.0.0: 대상·결과 파일 상한을 8 MiB로 올렸다. read-text-lines와 같은 값이다. edit 인자 상한(64 KiB, 32개)은 그대로다. commit 직전 확인과 verifier도 8 MiB까지 읽는다.
  • write-atomic은 64 KiB 그대로다.
  • planner 안내문에 digest 출처를 적었다.
  • ADR-0056을 추가하고 관련 문서를 갱신했다.

영향

workspace profile digest가 바뀐다. 이 변경 이전 binary로 시작해서 멈춘 workspace Run은 재개가 거절된다. 완료된 Run의 replay는 영향이 없다.

검증

  • cargo test --workspace 728개 통과, clippy 통과.
  • e2e:
    • 큰 파일을 범위로 읽고 fileDigest로 patch하면 exit 0으로 끝난다.
    • 8 MiB를 넘는 파일은 code=too_large로 멈춘다.
  • 실사용 A/B (deepseek profile, 사례마다 3회):
사례 main 이 변경
113 KB 파일 한 줄 (설계) 0/3 (too_large) 3/3, 4단계, 10~12초
75 KB 파일 두 곳 (설계) 0/3 3/3, 4단계, 12초
97 KB 파일 두 곳 (검증용) 0/3 3/3, 4단계, 10~13초
  • 회귀 확인:
    • 작은 파일 동시 편집은 2/2 회복됐다.
    • 9 MB 파일은 apply-patch로 열리지 않았다.

🤖 Generated with Claude Code

75 KB, 113 KB 소스 파일의 한 줄 수정 요청이 too_large로 끝났다.
apply-patch가 대상 파일 자체를 64 KiB까지만 읽었고, 큰 파일은
expectedDigest로 쓸 파일 digest를 얻을 방법도 없었다.

- read-text-lines 2.0.0: 출력에 fileDigest(파일 전체 SHA-256)를 더했다.
- apply-patch 2.0.0: 대상·결과 파일 상한을 read-text-lines와 같은 8 MiB로
  올렸다. edit 인자 상한(64 KiB, 32개)은 그대로라 journal과 planning
  context 크기 근거는 바뀌지 않는다. commit 확인과 verifier도 8 MiB까지 읽는다.
- planner 안내문에 digest 출처(read-text digest 또는 fileDigest)를 적었다.

실사용 A/B(deepseek, 사례마다 3회): 113 KB·75 KB(설계)와 97 KB(검증용)
수정이 main에서는 9회 모두 too_large였고, 이 변경 뒤에는 9회 모두
4단계·10~13초에 정확히 고쳐졌다. 동시 편집 복구와 8 MiB 초과 거절은
그대로다. cargo test --workspace 728개 통과.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@SonAIengine
SonAIengine merged commit 3111d74 into main Oct 25, 2026
3 checks passed
@SonAIengine
SonAIengine deleted the feat/large-file-patch branch October 25, 2026 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant