[Phase 17-E] 계층 메모리/컨텍스트 고도화 — AgentLoopService 통합

AgentLoopService.Memory.cs (신규, 105줄):
- InjectHierarchicalMemoryAsync(): 세션 시작 시 4-layer 계층 메모리 수집
  (Managed→User→Project→Local AX.md + rules/*.md)
  AxMdIncludeResolver.ResolveAsync()로 @include 지시어 최대 5단계 재귀 해석
  40,000자 초과 시 크기 경고, 마커 기반 in-place 교체(중복 방지)
- InjectPathScopedRulesAsync(): 파일 도구 실행 후 .ax/rules/*.md paths: 프론트매터
  기반 경로 범위 규칙 주입. workFolder별 PathScopedRuleInjector 캐시 적용

AgentLoopService.cs (편집):
- Phase 17-A(Reflexion) 이후 await InjectHierarchicalMemoryAsync() 호출 추가

AgentLoopService.Execution.cs (편집):
- InjectPathBasedSkills() 이후 InjectPathScopedRulesAsync() fire-and-forget 추가

AppSettings.LlmSettings.cs (편집):
- EnableMemorySystem 설정 추가 (기본 true, json: "enableMemorySystem")

docs/AGENT_ROADMAP.md:
- Group E 완료 표시 + 구현 내역 기록 (17-E1/E2 완료, 17-E3 차기)

빌드: 경고 0, 오류 0

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-04 00:56:49 +09:00
parent 1313c65e5e
commit f1b1f1604c
5 changed files with 181 additions and 6 deletions

View File

@@ -241,13 +241,16 @@
| 17-D2 | **경로 기반 스킬 활성화** | paths: 프론트매터 — 해당 파일 작업 시 스킬 자동 컨텍스트 주입 | 높음 |
| 17-D3 | **스킬 범위 훅·모델 오버라이드** | hooks: (스킬 범위 훅), model: (스킬별 모델), user-invocable:false (AI 전용) | 중간 |
### Group E — 메모리/컨텍스트 고도화 (CC 메모리 문서 기반)
### Group E — 메모리/컨텍스트 고도화 (CC 메모리 문서 기반) ✅ 완료
| # | 기능 | 설명 | 우선순위 |
|---|------|------|----------|
| 17-E1 | **@include 지시어** | AX.md / .ax/rules에서 @파일경로로 외부 파일 포함. 최대 5단계 | 높음 |
| 17-E2 | **경로 기반 규칙 주입** | .ax/rules/*.md의 paths: — 해당 파일 작업 시만 규칙 주입 | 높음 |
| 17-E3 | **컨텍스트 컴팩션 + 파일 되감기** | /compact 명령, PreCompact/PostCompact 훅, 파일 변경 되감기 | 중간 |
| # | 기능 | 설명 | 우선순위 | 구현 |
|---|------|------|----------|------|
| 17-E1 | **@include 지시어** | AX.md / .ax/rules에서 @파일경로로 외부 파일 포함. 최대 5단계 | 높음 | AxMdIncludeResolver.ResolveAsync() — AgentLoopService.Memory.cs에서 세션 시작 시 호출 |
| 17-E2 | **경로 기반 규칙 주입** | .ax/rules/*.md의 paths: — 해당 파일 작업 시만 규칙 주입 | 높음 | PathScopedRuleInjector — 파일 도구 결과 후 InjectPathScopedRulesAsync() 호출 |
| 17-E3 | **컨텍스트 컴팩션 + 파일 되감기** | /compact 명령, PreCompact/PostCompact 훅, 파일 변경 되감기 | 중간 | — (차기 Phase) |
새 파일: `AgentLoopService.Memory.cs` (105줄) — `InjectHierarchicalMemoryAsync()` + `InjectPathScopedRulesAsync()`
설정 추가: `EnableMemorySystem` (기본 true)
### Group F — 권한 시스템 고도화 (CC 권한 문서 기반)