코드 탭 컨텍스트 격차를 해소하고 대화 영속 작업 세트를 도입함

- ChatConversation에 CodeWorkingSetSnapshot/진단/시맨틱 요약 상태를 추가하고 AgentLoop가 실행 중 갱신한 작업 세트를 대화에 다시 저장하도록 연결함
- CodeTaskWorkingSetService를 스냅샷 복원/시맨틱 연속성 요약/활성 진단 보호 구조로 확장하고 query assembly에서 working set·semantic summary·workspace bootstrap을 protected evidence로 주입하도록 보강함
- ContextCondenser가 compact 중 MsgId, preview, 토큰 메타데이터를 유지하도록 수정하고 신규 compact marker와 요약 문자열을 영어 안정형으로 정리함
- ChatSessionStateService의 분기 대화가 MsgId와 CodeWorkingSet을 유지하도록 보강하고 관련 회귀 테스트(ChatStorage/ContextCondenser/PreLlmStage/QueryAssembly/WorkingSet)를 추가 및 갱신함
- 검증: dotnet build 경고 0 오류 0, CodeTaskWorkingSetServiceTests|AgentLoopQueryAssemblyServiceTests|AgentQueryContextBuilderTests|ContextCondenserTests|AxAgentExecutionEngineTests|AgentLoopLlmDispatchStageServiceTests|ChatStorageServiceTests 26개 통과, AgentLoopE2ETests 포함 관련 컨텍스트 회귀 56개 통과
This commit is contained in:
2026-04-16 09:01:00 +09:00
parent d5dbaa6e4a
commit 998f0c9fd5
20 changed files with 725 additions and 74 deletions

View File

@@ -1908,3 +1908,22 @@ UI ?遺우쁽????域뱀뮆???귐뗫솯?醫딆춦 ???袁る퓮 ?臾믩씜 ??疫
- 테스트: `src/AxCopilot.Tests/Services/CodeStatsAggregatorTests.cs`
- 검증: `dotnet build src/AxCopilot/AxCopilot.csproj -c Release -v minimal -p:OutputPath=bin\\verify_code_stats_merge\\ -p:IntermediateOutputPath=obj\\verify_code_stats_merge\\` 경고 0 / 오류 0
- 검증: `dotnet test src/AxCopilot.Tests/AxCopilot.Tests.csproj -c Release -v minimal --filter "CodeStatsAggregatorTests|AxAgentExecutionEngineTests|AgentQueryContextBuilderTests|ContextCondenserTests|SettingsServiceTests" -p:OutputPath=bin\\verify_code_stats_merge_tests\\ -p:IntermediateOutputPath=obj\\verify_code_stats_merge_tests\\` 통과 56
업데이트: 2026-04-16 09:12 (KST)
- Code context continuity was hardened with a durable `CodeWorkingSetSnapshot` that is now owned by `ChatConversation` and refreshed throughout Code runs.
- `src/AxCopilot/Models/ChatModels.cs` added `CodeWorkingSetSnapshot`, `CodeWorkingSetDiagnosticSnapshot`, and `CodeWorkingSetSemanticSummary`, and `ChatConversation` now persists the snapshot through the normal encrypted conversation save path.
- `src/AxCopilot/Services/Agent/CodeTaskWorkingSetService.cs` now restores snapshots, emits a dedicated semantic summary block, tracks active diagnostics and recent writes as protected evidence, and publishes only materially changed snapshots.
- `src/AxCopilot/Services/Agent/AgentLoopService.cs`, `src/AxCopilot/Services/Agent/AgentLoopCodeWorkingSetPersistence.cs`, and `src/AxCopilot/Views/ChatWindow.xaml.cs` now hydrate the Code working set at loop start, publish updates during tool execution, and persist the latest Code snapshot back into the owning conversation.
- `src/AxCopilot/Services/Agent/AgentLoopQueryAssemblyService.cs`, `src/AxCopilot/Services/Agent/AgentLoopLlmRequestPreparationService.cs`, `src/AxCopilot/Services/Agent/AgentQueryContextBuilder.cs`, and `src/AxCopilot/Services/Agent/AgentLoopContextReliability.cs` now inject and log Code-specific protected evidence for the working set, semantic continuity, active diagnostics, compact-boundary state, legacy marker fallback use, and workspace bootstrap context.
- `src/AxCopilot/Services/Agent/ContextCondenser.cs` now preserves `MsgId`, preview metadata, response timing, and token metadata during compaction, while newly written compaction markers and summaries use stable English strings.
- `src/AxCopilot/Services/ChatSessionStateService.cs` now preserves `CodeWorkingSet` and `MsgId` when branching conversations so forked Code threads keep the same repair chain.
- Tests:
- `src/AxCopilot.Tests/Services/CodeTaskWorkingSetServiceTests.cs`
- `src/AxCopilot.Tests/Services/ChatStorageServiceTests.cs`
- `src/AxCopilot.Tests/Services/ContextCondenserTests.cs`
- `src/AxCopilot.Tests/Services/AgentLoopQueryAssemblyServiceTests.cs`
- `src/AxCopilot.Tests/Services/AgentLoopPreLlmStageServiceTests.cs`
- `src/AxCopilot.Tests/Services/AgentLoopLlmDispatchStageServiceTests.cs`
- Verification:
- `dotnet build src/AxCopilot/AxCopilot.csproj -c Release -v minimal -p:OutputPath=bin\\verify_code_context_gap_closure_final\\ -p:IntermediateOutputPath=obj\\verify_code_context_gap_closure_final\\` warning 0 / error 0
- `dotnet test src/AxCopilot.Tests/AxCopilot.Tests.csproj -c Release -v minimal --filter "CodeTaskWorkingSetServiceTests|AgentLoopQueryAssemblyServiceTests|AgentQueryContextBuilderTests|ContextCondenserTests|AxAgentExecutionEngineTests|AgentLoopLlmDispatchStageServiceTests|ChatStorageServiceTests" -p:OutputPath=bin\\verify_code_context_gap_closure_tests\\ -p:IntermediateOutputPath=obj\\verify_code_context_gap_closure_tests\\` passed 26
- `dotnet test src/AxCopilot.Tests/AxCopilot.Tests.csproj -c Release -v minimal --filter "AgentLoopE2ETests|AgentMessageInvariantHelperTests|AgentLoopPreLlmStageServiceTests|AgentLoopLlmRequestPreparationServiceTests|AgentLoopQueryAssemblyServiceTests|CodeTaskWorkingSetServiceTests|ContextCondenserTests|AxAgentExecutionEngineTests|ChatStorageServiceTests|AgentQueryContextBuilderTests" -p:OutputPath=bin\\verify_code_context_gap_closure_tests2\\ -p:IntermediateOutputPath=obj\\verify_code_context_gap_closure_tests2\\` passed 56