코드탭 로그에서 드러난 대화 저장소 복호화 오탐을 수정한다

- CryptoService 평문 JSON 판별을 UTF-8 디코드 성공과 BOM/공백 제거 후 JSON 시작 문자 확인으로 강화
- 암호문 선행 바이트가 '[' 또는 0xEF인 경우와 UTF-8 BOM 평문 대화 파일 복원 회귀 테스트 추가
- README와 DEVELOPMENT 문서에 2026-04-15 19:12 KST 기준 로그 원인 및 검증 결과 기록

검증:
- dotnet build src/AxCopilot/AxCopilot.csproj -c Release -v minimal -p:OutputPath=bin\\verify_chat_storage_fix\\ -p:IntermediateOutputPath=obj\\verify_chat_storage_fix\\
- dotnet test src/AxCopilot.Tests/AxCopilot.Tests.csproj -c Release -v minimal --filter ChatStorageServiceTests -p:OutputPath=bin\\verify_chat_storage_fix_tests\\ -p:IntermediateOutputPath=obj\\verify_chat_storage_fix_tests\
This commit is contained in:
2026-04-15 19:05:21 +09:00
parent 5ab04bc53e
commit 913b42b2f3
4 changed files with 194 additions and 29 deletions

View File

@@ -2180,3 +2180,11 @@ MIT License
- 검증:
- `dotnet build src/AxCopilot/AxCopilot.csproj -c Release -v minimal -p:OutputPath=bin\\verify_internal_llm_scope\\ -p:IntermediateOutputPath=obj\\verify_internal_llm_scope\\` 경고 0 / 오류 0
- `dotnet test src/AxCopilot.Tests/AxCopilot.Tests.csproj -c Release -v minimal --filter "LlmOperationModeTests" -p:OutputPath=bin\\verify_internal_llm_scope_tests\\ -p:IntermediateOutputPath=obj\\verify_internal_llm_scope_tests\\` 통과 5
업데이트: 2026-04-15 19:12 (KST)
- Code 탭 실행 로그를 분석해 대화 저장소 복호화 회귀를 수정했습니다. 2026-04-15 18:44 실행(`convId=08179304`) 자체는 완료됐고, 실제 경고는 직전 메타 로드/만료 정리 단계에서 `.axchat` 암호문이 우연히 `[`(`0x5B`) 또는 `0xEF`로 시작할 때 평문 JSON으로 잘못 판별되며 발생하고 있었습니다.
- `src/AxCopilot/Services/CryptoService.cs`는 평문 JSON 판별을 `실제 UTF-8 디코드 성공 + BOM/공백 제거 후 JSON 시작 문자 확인`으로 강화했습니다. 이제 암호화 바이너리가 우연히 JSON처럼 보이는 첫 바이트를 가져도 복호화 경로로 처리하고, 구버전 UTF-8 BOM 평문 대화 파일은 정상적으로 읽어들입니다.
- `src/AxCopilot.Tests/Services/ChatStorageServiceTests.cs`에 회귀 테스트를 추가했습니다. 암호문 선행 바이트가 `[` 또는 `0xEF`인 대화 파일과 UTF-8 BOM이 있는 평문 대화 파일이 모두 `Load()``LoadAllMeta()`에서 정상 복원되는지 검증합니다.
- 검증:
- `dotnet build src/AxCopilot/AxCopilot.csproj -c Release -v minimal -p:OutputPath=bin\\verify_chat_storage_fix\\ -p:IntermediateOutputPath=obj\\verify_chat_storage_fix\\` 경고 0 / 오류 0
- `dotnet test src/AxCopilot.Tests/AxCopilot.Tests.csproj -c Release -v minimal --filter "ChatStorageServiceTests" -p:OutputPath=bin\\verify_chat_storage_fix_tests\\ -p:IntermediateOutputPath=obj\\verify_chat_storage_fix_tests\\` 통과 4