AX Agent 도구·스킬 정합성 재구성 및 실행 품질 보강

변경 목적:
- AX Agent의 도구 이름, 내부 설정, 스킬 정책, 실행 루프 사이의 불일치를 줄이고 전체 동작 품질을 높인다.
- claw-code 수준의 일관된 동작 품질을 참고하되 AX 구조에 맞는 고유한 카탈로그·정규화 레이어로 재구성한다.

핵심 수정사항:
- 도구 canonical id, legacy alias, 탭 노출, 설정 카테고리, read-only 분류를 중앙 카탈로그로 통합했다.
- ToolRegistry, AgentLoopService, 병렬 실행 분류, 권한 처리, 훅 처리, 스킬 allowed-tools 해석이 같은 이름 체계를 사용하도록 정리했다.
- Agent 설정/일반 설정/도움말의 도구 카드와 훅 편집기, 스킬 설명을 현재 런타임 구조에 맞게 갱신했다.
- 컨텍스트 압축, intent gate, spawn agents, session learning, model prompt adapter, workspace context 관련 변경과 테스트 추가를 함께 반영했다.
- 문서 이력과 비교/로드맵 문서를 최신 상태로 갱신했다.

검증 결과:
- dotnet build src/AxCopilot/AxCopilot.csproj -c Release -v minimal -p:OutputPath=bin\verify_toolcat\ -p:IntermediateOutputPath=obj\verify_toolcat\ : 경고 0 / 오류 0
- dotnet test src/AxCopilot.Tests/AxCopilot.Tests.csproj -c Release -v minimal --filter AgentToolCatalogTests -p:OutputPath=bin\verify_toolcat_tests\ -p:IntermediateOutputPath=obj\verify_toolcat_tests\ : 통과 8
This commit is contained in:
2026-04-14 17:52:46 +09:00
parent fa33b98f7e
commit 8cb08576d5
200 changed files with 13522 additions and 5764 deletions

View File

@@ -9,13 +9,13 @@
- v0.7.2: 컨텍스트 압축/복원 안정화, UX/성능 보완.
## 2. 재작성 기준
- 기준 레퍼런스: `claw-code/claw-code-f5a40b86dede580f6543bf8926c9af017eea9409/src`.
- 기준 레퍼런스: `OpenCode/OpenCode-f5a40b86dede580f6543bf8926c9af017eea9409/src`.
- 목표: 동작 순서, 예외/검증 흐름, 세션 내구성에서 동일 품질 달성.
- 원칙: AX 코드 스타일로 재구성(표현/구조 변경), 기능적 동등성 유지.
## 3. 2026 실행 계획 (v0.7.3 ~ v0.8.0)
| Phase | 참조 대상 (`claw-code`) | AX 적용 위치 | 완료 조건 | 품질 판정 시나리오 |
| Phase | 참조 대상 (`OpenCode`) | AX 적용 위치 | 완료 조건 | 품질 판정 시나리오 |
|---|---|---|---|---|
| A (v0.7.3) Hook/Permission 계약 고도화 | `src/utils/hooks.ts`, `src/utils/hooks/hookEvents.ts`, `src/utils/permissions/PermissionUpdate.ts`, `src/utils/permissions/permissionSetup.ts` | `src/AxCopilot/Services/Agent/AgentHookRunner.cs`, `src/AxCopilot/Services/Agent/AgentLoopService.cs`, `src/AxCopilot/Models/AppSettings.cs`, `src/AxCopilot/ViewModels/SettingsViewModel.cs`, `src/AxCopilot/Views/SettingsWindow.xaml` | Hook JSON 출력(`updatedInput`, `updatedPermissions`, `additionalContext`) 반영 완료. Plain text 훅 하위호환 유지. 훅 실패 비차단 유지. | Pre-hook 입력 변형 적용 시 도구 입력이 실제 변경되는지 검증. 권한 업데이트 후 동일 run 내 권한 판정이 즉시 반영되는지 검증. |
| B (v0.7.4) Plan/Run 상태 내구성 강화 | `src/utils/plans.ts`, `src/utils/sessionStorage.ts` | `src/AxCopilot/Services/ChatSessionStateService.cs`, `src/AxCopilot/Services/TaskRunService.cs`, `src/AxCopilot/Services/TaskRunStore.cs`, `src/AxCopilot/Views/ChatWindow.xaml.cs` | Plan 단계 승인/수정 이력 영속화. 앱 재시작 후 run 재개 시 마지막 실행 지점 정확 복원. 중복 실행/중복 이벤트 0건. | 실행 중 앱 종료 → 재실행 → 같은 탭/대화에서 run 상태와 최근 실행 이력이 일치하는지 검증. |
@@ -65,7 +65,7 @@
- 2026-04-04(추가3): 권한 UX 통합(/permissions·/allowed-tools·/settings permissions), 복구 혼합 테스트 보강, 좌측 패널 실패 필터 노출 정책 rich 전용으로 정렬.
- 2026-04-04 20:27 (KST): Added a dedicated AX Agent theme layer and separated in-chat theme selection into style (`claw/codex/slate`) and mode (`system/light/dark`).
- 2026-04-04 20:27 (KST): Added a dedicated AX Agent theme layer and separated in-chat theme selection into style (`claude/codex/slate`) and mode (`system/light/dark`).
- 2026-04-04 18:03 (KST): Added a Codex-style context usage ring to the composer, exposed direct `/compact` execution from the footer, and surfaced Git branch/change status in the Cowork/Code footer when a repository is connected.
- 2026-04-04 18:03 (KST): Simplified the Cowork footer by removing document format/design selectors and moved those defaults into the AX Agent settings page, with output format centered on AI automatic selection.
- 2026-04-04 18:03 (KST): Minimized AX Agent message headers, changed model quick controls to a popup panel, flattened slash command rows into a Codex-style list, and aligned model/permission/template controls to the same dropdown panel language.
@@ -79,12 +79,12 @@
- 2026-04-04 19:07 (KST): Refined message actions into custom pill buttons with visible labels, fixed the custom action template so border visuals render correctly, and tightened composer/footer density so model, preset, token, permission, and Git controls feel like one system.
- 2026-04-04 19:11 (KST): Reworked the AX Agent timeline so execution events render like thin Codex-style inline logs instead of heavy banners, softened older-history loading into an outline pill, and aligned planning cards to the same message-width rhythm.
- 2026-04-04 19:25 (KST): Tightened user/assistant/streaming cards under one density rule by compressing vertical spacing, card padding, header typography, and message meta spacing to a more Codex-like rhythm.
- 2026-04-04 19:25 (KST): Flattened the composer further by reducing input, model, preset, token, and footer control heights so the bottom work area reads more like a single claw-code-style strip.
- 2026-04-04 19:25 (KST): Flattened the composer further by reducing input, model, preset, token, and footer control heights so the bottom work area reads more like a single OpenCode-style strip.
- 2026-04-04 19:25 (KST): Matched AX Agent overlay quick settings to inline quick settings with the same `label · value` structure, lighter explanatory copy, and unified section naming.
- 2026-04-04 19:48 (KST): Fixed Chat sidebar topic exploration so clicking the left topic entry surfaces the preset cards again, and made preset selection immediately sync category label, conversation metadata, and saved state.
- 2026-04-04 19:48 (KST): Reduced permission/data-usage UI lag by synchronizing conversation settings before persistence, switching popup rows to immediate mouse-down activation, and refreshing overlay status labels in the same turn.
- 2026-04-04 19:48 (KST): Widened the AX Agent message lane, softened the yellow cast of the Claude-style theme preset, aligned the data-usage button with the permission button language, and routed the tray settings entry directly into AX Agent settings when AI is enabled.
- 2026-04-04 20:41 (KST): Permission surface re-aligned to the four claw-code public modes, legacy `질문 없이 진행` exposure removed from AX Agent popups/slash guidance, and the in-chat settings/sidebar information hierarchy simplified to match the lighter Claude/Codex-style layout direction.
- 2026-04-04 20:41 (KST): Permission surface re-aligned to the four OpenCode public modes, legacy `질문 없이 진행` exposure removed from AX Agent popups/slash guidance, and the in-chat settings/sidebar information hierarchy simplified to match the lighter Claude/Codex-style layout direction.
- 업데이트: 2026-04-04 22:05 (KST)
- AX Agent 고급 설정 오버레이를 설명형 row + 커스텀 On/Off 선택 구조로 개편하고, 내부 기능명을 사용자 친화 문구로 정리함.
- 업데이트: 2026-04-04 20:58 (KST)
@@ -104,3 +104,127 @@
- ????: 2026-04-04 23:32 (KST)
- AX Agent ???? ??? ?? tool-result ?? -> microcompact ?? ?? ?? -> ?? ?? ?? 3?? ??? ???, claude-code? staged compact ??? ? ??? ? ?? ??? ?? ????? ???.
- ??? ?? ??, tool_result, ?? ???, ???? ? ???? LLM ?? ?? microcompact_boundary? ?? ??? ?? ?? ?? ?? ?? ?? ??? ??? ???? ?? ??.
---
## 8. 지능형 에이전트 고도화 로드맵 (oh-my-openagent 참조)
> 기준: oh-my-openagent 아키텍처 분석 결과에서 단일 모델 환경에서도 효과적인 기능을 우선 채택.
> 원칙: AX 기존 인프라(`ClassifyTaskType`, `SubAgentTool`, `IntentDetector`, `TaskTypePolicy`, `ContextCondenser`) 위에 점진적으로 확장.
### 8-1. 즉시 개발 (P1~P5)
#### P1. IntentGate — 고급 의도 분류기
- **목적**: 사용자 입력을 분석하여 최적 실행 프로파일(system prompt + temperature + tool 권한 + 최대 반복)을 자동 선택
- **현재 상태**: `ClassifyTaskType()` (키워드 6분류) + `IntentDetector` (키워드 7분류, UI 힌트용) 존재하나 실행 프로파일 연동 없음
- **구현 계획**:
1. `IntentGateService.cs` 신규 — 2단계 분류기
- Stage 1: 키워드 기반 빠른 분류 (기존 `ClassifyTaskType` + `IntentDetector` 통합)
- Stage 2: LLM 1-shot 분류 (복합 요청 시만 발동, 토큰 최소화)
2. `ExecutionProfile` 확장 — 분류 결과별 프로파일 매핑
- `code_edit`: temperature 0.3, 코드 도구 우선, 최대 반복 25
- `document_create`: temperature 0.7, 문서 도구 우선, 최대 반복 15
- `analysis`: temperature 0.4, 검색/읽기 도구 우선, 최대 반복 20
- `review`: temperature 0.2, 읽기 전용 도구, 최대 반복 15
- `general_chat`: 도구 없음, temperature 0.8
- `complex_task`: 전체 도구, temperature 0.5, SubAgent 활성화
3. `AgentLoopService.RunAsync()` 진입부에서 `IntentGateService.Classify()` 호출 → 프로파일 적용
- **수정 파일**: `IntentGateService.cs`(신규), `AgentLoopService.cs`, `AppSettings.cs`, `TaskTypePolicy.cs`
- **검증**: 코드수정/문서생성/분석/리뷰/잡담 5개 시나리오에서 올바른 프로파일 선택 확인
#### P2. 카테고리 기반 서브에이전트 실행 프로파일
- **목적**: 같은 모델이지만 작업 유형별로 다른 system prompt + tool 권한 + temperature를 적용하는 "가상 멀티에이전트"
- **현재 상태**: `SubAgentTool`은 고정 system prompt + 읽기 전용 도구만 사용
- **구현 계획**:
1. `SubAgentProfile.cs` 신규 — 프로파일 정의 클래스
- `researcher`: 읽기 전용, 검색 집중, temperature 0.3
- `coder`: 파일 편집 가능, 빌드/테스트 도구 포함, temperature 0.2
- `writer`: 문서 생성 도구 활성, temperature 0.7
- `reviewer`: 코드리뷰 도구 + diff, temperature 0.2
- `planner`: 계획/분해 도구, temperature 0.5
2. `SubAgentTool` 확장 — `profile` 파라미터 추가
- 프로파일별로 system prompt, 도구 레지스트리, temperature를 자동 구성
- 기존 동작(profile 미지정)은 `researcher`로 폴백
3. `IntentGateService`가 복합 요청 감지 시 자동으로 서브에이전트 프로파일 추천
- **수정 파일**: `SubAgentProfile.cs`(신규), `SubAgentTool.cs`, `AgentLoopService.cs`
- **검증**: "코드 수정하고 문서도 만들어줘" → coder + writer 프로파일 분리 실행 확인
#### P3. 누적 학습 (Accumulated Learnings)
- **목적**: 세션 내 발견사항(에러 패턴, 파일 구조, 성공 전략)을 자동 수집하여 후속 반복에 주입
- **현재 상태**: `AgentMemoryService`에 장기 메모리 존재하나, 세션 내 단기 학습 전파 없음
- **구현 계획**:
1. `SessionLearningCollector.cs` 신규
- 도구 실행 결과에서 자동 학습 포인트 추출:
- 빌드 에러 → "이 프로젝트는 .NET 8, nullable 활성"
- grep 결과 → "이 패턴은 Services/ 폴더에 집중"
- 파일 구조 → "테스트는 Tests/ 폴더, 네이밍 규칙 *Tests.cs"
- 최대 10개 항목, FIFO 관리
2. `AgentLoopService` — 각 반복 시작 시 누적 학습을 컨텍스트에 주입
- `[System:SessionLearnings]` 메시지로 삽입 (압축 시 보존)
3. `ContextCondenser` — 학습 메시지는 압축 대상에서 제외
- **수정 파일**: `SessionLearningCollector.cs`(신규), `AgentLoopService.cs`, `ContextCondenser.cs`
- **검증**: 빌드 에러 발생 후 다음 반복에서 동일 실수 반복 안 하는지 확인
#### P4. 워크스페이스 컨텍스트 자동 생성 (.ax-context)
- **목적**: 작업 폴더의 구조/기술스택/컨벤션을 파일로 자동 생성 → 서브에이전트 컨텍스트 효율화
- **현재 상태**: `ProjectRuleTool``.ax-rules` 파일을 읽지만 자동 생성 없음
- **구현 계획**:
1. `WorkspaceContextGenerator.cs` 신규
- 작업 폴더 최초 접근 시 자동 분석:
- 파일 트리 (깊이 3), 주요 확장자 분포, 빌드 시스템 감지
- README/package.json/csproj 등에서 프로젝트 메타 추출
- 기존 `.ax-rules`, `.clinerules`, `CLAUDE.md` 존재 여부
- 결과를 `.ax-context.md`로 저장 (1회 생성, 수동 갱신)
2. `SubAgentTool` — 서브에이전트 생성 시 `.ax-context.md` 내용을 system prompt에 자동 주입
3. `AgentLoopService` — 메인 에이전트도 `.ax-context.md` 존재 시 컨텍스트에 포함
- **수정 파일**: `WorkspaceContextGenerator.cs`(신규), `SubAgentTool.cs`, `AgentLoopService.cs`, `ProjectRuleTool.cs`
- **검증**: 새 작업 폴더 선택 → `.ax-context.md` 자동 생성 → 서브에이전트가 프로젝트 구조 인지 확인
#### P5. 병렬 서브에이전트 실행 확장
- **목적**: LLM이 한 번의 응답에서 여러 서브에이전트를 동시 생성/실행
- **현재 상태**: `SubAgentTool`은 개별 호출 가능하나 LLM이 연속 호출해야 함. `AgentLoopParallelExecution`에서 병렬 도구 실행 지원
- **구현 계획**:
1. `spawn_agents` (복수형) 도구 신규 — 배열로 여러 서브에이전트를 한 번에 생성
- `tasks: [{id, task, profile}, ...]` 형태
2. `IntentGateService` — 복합 요청 감지 시 자동 분해
- "A 분석하고 B 코드 수정해줘" → 두 개의 서브에이전트로 자동 분해 제안
3. `SubAgentTool` — 동시 실행 상한을 설정에서 조정 가능 (기본 3 → 5)
4. UI: 서브에이전트 진행 상태를 타임라인에 병렬로 표시
- **수정 파일**: `SpawnAgentsTool.cs`(신규), `SubAgentTool.cs`, `AgentLoopService.cs`, `AppSettings.cs`
- **검증**: 3개 서브에이전트 동시 실행 → 결과 수집 → 통합 응답 확인
### 8-2. 추후 개발 (P6~P7)
#### P6. 폴백 체인 (Fallback Chains)
- **목적**: 실행 실패 시 다른 프로파일/전략으로 자동 재시도
- **구현 방향**: IntentGate 프로파일에 `fallback` 속성 추가. 1차 실패 → 프로파일 전환 → 재시도 (최대 2회)
- **선행 조건**: P1(IntentGate) + P2(카테고리 프로파일) 완료 후
- **예상 파일**: `IntentGateService.cs`, `AgentLoopService.cs`
#### P7. 모델 성격 매칭 (Model Personality Matching)
- **목적**: 멀티 모델 환경에서 작업 유형별 최적 모델 자동 선택
- **구현 방향**: `RegisteredModel``strengths` 속성 추가 (coding/writing/analysis/speed). IntentGate 분류 결과 + 모델 강점 매칭으로 최적 모델 라우팅
- **선행 조건**: 멀티 모델 환경 확보 + P1(IntentGate) 완료 후
- **예상 파일**: `IntentGateService.cs`, `ModelRouterService.cs`, `AppSettings.cs`
### 8-3. 구현 순서 및 의존 관계
```
P1 (IntentGate) ─────┬──→ P2 (카테고리 프로파일) ──→ P5 (병렬 확장)
├──→ P3 (누적 학습) [독립]
└──→ P4 (워크스페이스 컨텍스트) [독립]
P1 + P2 완료 후 ──→ P6 (폴백 체인)
P1 + 멀티모델 후 ──→ P7 (모델 성격 매칭)
```
### 8-4. 단일 모델에서의 멀티에이전트 원리
> Claude Code, Codex, Cursor 등 주요 AI 코딩 도구는 모두 **단일 모델 + 다른 시스템 프롬프트/도구 권한/temperature** 조합으로 멀티에이전트를 구현합니다.
>
> - 메인 에이전트: 범용 system prompt + 전체 도구 + 중간 temperature
> - 서브에이전트: 특화 system prompt + 제한된 도구 + 작업별 temperature
>
> AX Copilot도 이 패턴을 따릅니다. `SubAgentTool`이 이미 존재하므로, **프로파일 체계화(P2)**만으로 사실상 멀티에이전트가 됩니다.

View File

@@ -2,7 +2,7 @@
업데이트: 2026-04-08 10:38 (KST)
`claw-code`와 AX Agent를 같은 기준으로 비교하기 위한 공통 회귀 프롬프트 세트입니다.
`OpenCode`와 AX Agent를 같은 기준으로 비교하기 위한 공통 회귀 프롬프트 세트입니다.
## 사용 규칙

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -26,8 +26,8 @@
- `skills/*.skill.md` 파일 수: 41
- Slash 명령 매핑 엔트리 수: 85
## 4) claw-code 비교 포인트 (실행 반영 기준)
- claw-code 문서 기준 핵심 slash: `/permissions`, `/mcp` 확인
## 4) OpenCode 비교 포인트 (실행 반영 기준)
- OpenCode 문서 기준 핵심 slash: `/permissions`, `/mcp` 확인
- AX 현재 매핑에 `/permissions`, `/allowed-tools`, `/mcp`, `/chrome`, `/compact` 포함
- 다음 보강 우선순위:
1. 수동 시나리오 기반 MCP/Chrome 진단 품질 강화

View File

@@ -8,7 +8,7 @@
## 2. 재작성 기준
- 런처는 AX Agent 실행 품질을 끌어올리는 입력 허브로 재정의.
- claw-code의 명령 중심 워크플로우를 AX Commander UX에 맞게 흡수.
- OpenCode의 명령 중심 워크플로우를 AX Commander UX에 맞게 흡수.
## 3. 2026 실행 계획 (v0.7.3 ~ v0.8.x)

View File

@@ -6,17 +6,17 @@
- v0.7.0~v0.7.2: Plan Mode, 병렬 도구, 검증 게이트 및 안정화 강화.
## 2. 재작성 목표
- claw-code 수준의 실행 신뢰성, 세션 내구성, 결과 품질 확보.
- OpenCode 수준의 실행 신뢰성, 세션 내구성, 결과 품질 확보.
- AX Copilot 고유 제약(사내 운영모드, WPF UX, 로컬 우선)을 유지한 동등 품질 구현.
## 3. 마일스톤
| 마일스톤 | 참조 대상 (`claw-code`) | AX 적용 위치 | 완료 조건 | 품질 판정 시나리오 |
| 마일스톤 | 참조 대상 (`OpenCode`) | AX 적용 위치 | 완료 조건 | 품질 판정 시나리오 |
|---|---|---|---|---|
| M1 (v0.7.3) Hook 계약 정식화 | `src/utils/hooks.ts`, `src/utils/hooks/hookEvents.ts`, `src/utils/permissions/PermissionUpdate.ts` | `src/AxCopilot/Services/Agent/AgentHookRunner.cs`, `src/AxCopilot/Services/Agent/AgentLoopService.cs`, `src/AxCopilot/Models/AppSettings.cs`, `src/AxCopilot/ViewModels/SettingsViewModel.cs`, `src/AxCopilot/Views/SettingsWindow.xaml` | Hook 출력 계약(`updatedInput`, `updatedPermissions`, `additionalContext`) 반영. 설정값-실행코드-UI 동시 반영. | JSON 훅/텍스트 훅 혼합 환경에서 실행 품질과 하위호환 유지 확인. |
| M2 (v0.7.4~v0.7.5) 세션/로그 내구성 | `src/utils/plans.ts`, `src/utils/sessionStorage.ts` | `src/AxCopilot/Services/ChatSessionStateService.cs`, `src/AxCopilot/Services/TaskRunService.cs`, `src/AxCopilot/Services/TaskRunStore.cs`, `src/AxCopilot/Views/ChatWindow.xaml.cs`, `src/AxCopilot/Models/ChatModels.cs` | Plan/Run 상태 영속화. 이벤트 로그 표준화 및 replay 안정성 확보. | 앱 재시작/강제종료 후 동일 세션 재개 시 상태/이력 불일치 0건. |
| M3 (v0.7.6) 도구 선택/복구 안정화 | `src/commands.ts`, `src/Tool.ts`, `src/query.ts` | `src/AxCopilot/Services/Agent/AgentLoopService.cs`, `src/AxCopilot/Services/Agent/AgentLoopParallelExecution.cs`, `src/AxCopilot/Services/LlmService.ToolUse.cs` | 도구 선택 실패 루프 억제. 실패 유형별 복구 흐름 정형화. | 오타/비활성/별칭 도구 요청이 반복 실패 없이 정상 경로로 수렴하는지 확인. |
| M4 (v0.8.0) 품질 게이트 최종 정렬 | `src/query.ts`, `src/QueryEngine.ts`, `src/utils/sessionStorage.ts` | `src/AxCopilot/Services/Agent/AgentLoopService.cs`, `src/AxCopilot/Services/Agent/AgentLoopTransitions.Execution.cs`, `src/AxCopilot/Services/Agent/AgentLoopTransitions.cs` | 증거 기반 완료 판정 고정. 내부 벤치마크에서 claw-code 동급 품질 달성. | 코드수정/문서생성/권한거부/복구 혼합 시나리오에서 조기완료 없이 근거 기반 종료 확인. |
| M4 (v0.8.0) 품질 게이트 최종 정렬 | `src/query.ts`, `src/QueryEngine.ts`, `src/utils/sessionStorage.ts` | `src/AxCopilot/Services/Agent/AgentLoopService.cs`, `src/AxCopilot/Services/Agent/AgentLoopTransitions.Execution.cs`, `src/AxCopilot/Services/Agent/AgentLoopTransitions.cs` | 증거 기반 완료 판정 고정. 내부 벤치마크에서 OpenCode 동급 품질 달성. | 코드수정/문서생성/권한거부/복구 혼합 시나리오에서 조기완료 없이 근거 기반 종료 확인. |
## 4. 측정 지표
- 반복 실패 루프 발생률.
@@ -48,12 +48,12 @@
2. 위 결과를 배포 전 체크리스트로 고정하고 매 릴리즈마다 수치 동기화.
## 9. 벤치마크 고정 기준 (CLAW 패리티 동기화)
- 기준 문서: `docs/CLAW_CODE_PARITY_PLAN.md` 12절.
- 기준 문서: `docs/OPENCODE_PARITY_PLAN.md` 12절.
- 고정 시나리오: 기본 loop / unknown-tool 복구 / plan 연결 / 권한 거부 / hook 입력 변형 / allowed-tools 강제 / hook filter.
- 합격 게이트: 빌드 경고·오류 0 + 전체 테스트 통과 + 고정 시나리오 회귀 통과.
## 10. Replay 안정성 검증 연동
- 기준 문서: `docs/CLAW_CODE_PARITY_PLAN.md` 13절.
- 기준 문서: `docs/OPENCODE_PARITY_PLAN.md` 13절.
- 테스트 태그: `Suite=ReplayStability`.
- 운영 기준: 릴리즈 전 `ReplayStability` 시나리오 전건 통과 시 replay 불일치 0건으로 판정.
- 최신 실행 증적(2026-04-03): `ParityBenchmark 13/13`, `ReplayStability 14/14`, 전체 `379/379`.
@@ -79,9 +79,9 @@
업데이트: 2026-04-04 13:24 (KST)
### 기준 소스
- claw-code/src/commands.ts
- claw-code/src/utils/permissions/PermissionMode.ts
- claw-code/src/components/PromptInput/PromptInput.tsx
- OpenCode/src/commands.ts
- OpenCode/src/utils/permissions/PermissionMode.ts
- OpenCode/src/components/PromptInput/PromptInput.tsx
### 현재 AX 격차 요약
1. 입력/슬래시/권한 처리 로직이 ChatWindow 단일 파일에 상대적으로 집중되어 변경 파급도가 큼.
@@ -116,7 +116,7 @@
### 3축 고정 운영
1. 로직 안정화: 권한/운영모드/compact/모델 연결 경로를 테스트 우선으로 보강.
2. 기능 동등성: claw-code 기준 주요 명령(/compact, /permissions, /mcp, /chrome)을 실행 시나리오로 검증.
2. 기능 동등성: OpenCode 기준 주요 명령(/compact, /permissions, /mcp, /chrome)을 실행 시나리오로 검증.
3. UX 정렬: 상단/컴포저/팝업 밀도는 로직 안정화 완료 범위 내에서만 단계 반영.
### 이번 사이클 기준 완료 조건

View File

@@ -0,0 +1,153 @@
# OpenCode 품질 동등화 계획 (전면 재작성)
## 1. 기준
- 레퍼런스: `E:\AX Copilot - Codex\OpenCode\OpenCode-f5a40b86dede580f6543bf8926c9af017eea9409\src`
- 동등화 범위: 명령 처리 흐름, 권한/훅 체계, plan/run 내구성, 세션/로그 관리.
## 2. 보존 이력 (요약만 유지)
- 루프 가드(반복 실패/정체 감지)와 검증 게이트는 이미 AX에 부분 반영.
- 병렬 도구 실행, Plan Mode, Unknown-tool 복구 로직은 반영 완료.
- 세션/이력 안정화는 진행 중.
## 3. 현재 갭
- Hook 출력의 구조화 계약 적용 범위가 제한적.
- 세션 재개/이벤트 replay 품질이 시나리오별 편차 존재.
- 도구 선택 실패 후 재시도 전략의 일관성 부족.
## 4. 단계별 실행
### P1 Hook 계약 고도화
- `updatedInput`, `updatedPermissions`, `additionalContext`를 AX 실행 루프에 반영.
- 설정 토글로 위험 기능 제어.
### P2 세션/이벤트 내구성
- run 상태 영속화와 resume 기준 고정.
- jsonl 이벤트 필드 표준화 및 재생 가능성 확보.
### P3 실패 복구 표준화
- unknown-tool/권한거부/파라미터 오류를 유형화.
- 유형별 복구 프롬프트와 다음 액션 우선순위 고정.
### P4 완료 품질 정렬
- 코드/문서 작업별 완료 체크리스트 표준화.
- 증거 없는 완료 응답 방지.
## 5. 완료 판정
- 내부 벤치마크 시나리오에서 목표 성공률 충족.
- 세션 재개/이벤트 재생 오류 0건.
- 빌드 경고 0/오류 0 유지.
## 6. 2026-04-03 점검 스냅샷
- 기준 시점: 2026-04-03.
- 계획 대비 현재 수준: 약 92~95%.
- 테스트 상태: `dotnet test` 374/374 통과.
- P1 Hook 계약: 구현 완료 수준.
- P2 세션/이벤트 내구성: 구현 완료 수준(복원/재생 경계 케이스 테스트 반영).
- P3 실패 복구 표준화: 구현 완료 수준(unknown-tool/권한/정체/fork 강제 흐름 반영).
- P4 완료 품질 정렬: 구현 완료 수준(게이트 로직 + 벤치마크 기준 문서화 완료).
## 7. 스킬/도구 운영 점검 (2026-04-03)
- 도구 레지스트리 등록 수: 65개 (`ToolRegistry.CreateDefault()` 기준).
- `IAgentTool` 구현 수: 65개. 동적 MCP 래퍼(`McpTool`)는 런타임 등록 구조로 정상.
- 내장 스킬 파일 수: 40개 (`src/AxCopilot/skills/*.skill.md`).
- `allowed-tools` 적용 스킬: 40/40.
- `requires: python` 고정 의존 스킬: 0개(기존 10개에 Python 가능/불가 분기 fallback 경로 반영).
- 레거시 도구명 `process_run` 참조: 0건 (`process`로 정규화).
- 레거시 도구명 `grep_tool` 참조: 0건 (`grep`로 정규화).
- 내부 모드 차단 정책: `http_tool` 전면 차단, `open_external`의 외부 URL 차단.
- 테스트 상태: `dotnet test` 374/374 통과.
## 8. OpenCode 소스 직접 비교 결과 (2026-04-03)
- 비교 기준 소스: `OpenCode/.../src/tools.ts`, `src/Tool.ts`, `src/skills/loadSkillsDir.ts`, `src/skills/bundled/*.ts`.
- OpenCode 도구 상수명: 41개 (`*_TOOL_NAME` 기준).
- AX 도구명: 65개 (`IAgentTool.Name` 기준).
- OpenCode 도구명 중 AX alias로 직접 해석되는 항목: 8개 (`Bash/Read/Write/Edit/Glob/Grep/WebFetch/WebSearch`).
- 미해석 항목(33개)은 대부분 제품 철학 차이 영역(예: `EnterPlanMode`, `ExitWorktree`, `TeamCreate`, `TodoWrite`, `ToolSearch`, `REPL`, `Cron*`).
- OpenCode 번들 스킬은 코드 등록형 14개(`registerBundledSkill`)이며, AX는 파일 기반 스킬 40개(`*.skill.md`) 중심 구성.
- 번들 스킬 이름 교집합은 0개이며(의도된 차별화), 품질 기준은 "이름 일치"가 아니라 "동작 등가(계획/복구/검증/권한/세션 내구성)"로 판단해야 함.
- OpenCode 스킬 메타데이터는 `allowedTools`, `whenToUse`, `model`, `disableModelInvocation`, `userInvocable`, `hooks`, `context`, `agent`, `paths`, `effort`, `shell`까지 지원.
- AX 스킬 메타데이터는 `allowed-tools`, `when_to_use`, `argument-hint`, `model`, `disable-model-invocation`, `user-invocable`, `context`, `agent`, `effort`, `paths`, `shell`, `hooks`, `hook_filters`까지 런타임 연계 확장 완료.
## 9. OpenCode 비교 기반 즉시 보완 항목 (반영 상태)
1. 스킬 frontmatter 확장: `when_to_use`, `argument-hint`, `model`, `disable-model-invocation`, `user-invocable`, `context`, `agent`, `effort`, `paths`, `shell` 반영 완료.
2. 스킬 실행 범위 제어: `paths` 기반 조건부 활성화 반영 완료(첨부 파일 경로 매칭 시 동적 활성화).
3. 도구 별칭 정규화: OpenCode 기본 도구명군(`WebFetch`, `WebSearch`, `AskUserQuestion`, `LSP`, `ListMcpResourcesTool` 등) AX 내부 도구명으로 매핑 반영 완료.
4. 반영 완료(2026-04-03): `hooks`/`hook_filters` 계약 확장 및 runtime hook 필터링(도구/타이밍 기준) 적용.
5. 반영 완료(2026-04-03): 슬래시 스킬 실행 시 `context/agent/effort/model/disable-model-invocation/allowed-tools/hooks/hook_filters` 메타데이터를 런타임 정책 지시문으로 합성 적용.
6. 반영 완료(2026-04-03): `permissionSetup` 비교 기반으로 위험 자동허용 가드 추가(`process`, `spawn_agent`, `snippet_runner`는 전역 `Auto`에서도 승인 단계 강제).
## 10. 전체 영역 동시 비교 기준 (누락 방지)
1. 도구 계층: 도구 목록, 별칭 정규화, unknown-tool 복구, tool search/선택 정책.
2. 스킬 계층: 로더, frontmatter, 번들/파일 기반 동시 운영, 조건부 활성화.
3. 훅/권한: pre/post hook 계약, permission update 반영, ask/auto/deny 일관성.
4. 세션/상태: run 복원, 이벤트 replay, 중복 이벤트 억제, resume 신뢰성.
5. 계획/실행: plan 승인/수정 이력, 실행 게이트, 조기 완료 방지.
6. MCP/외부도구: 연결/리소스 조회/읽기, 실패 복구, internal 모드 정책.
7. 서브에이전트: spawn/wait 제약, read-only 모드, 결과 회수 구조.
8. 운영/설정/UI 연동: 설정값-실행코드-UI 동기화, 탭별 분기(Cowork/Code) 일치.
## 11. 다음 적용 순서 (전체 영역 병렬 보정)
1. 기본 Agentic loop E2E 시나리오(도구 실행/unknown-tool 복구)를 회귀 테스트로 고정.
2. 벤치마크 합격 기준(시나리오/통과조건/증적)을 문서화하고 배포 체크리스트에 연결. (완료)
3. 최종 마감 시 패리티 문서(수치/상태)와 로드맵 문서를 동기화. (진행 중)
## 12. 내부 벤치마크 기준 (고정)
| 시나리오 | 기준 테스트 | 합격 기준 |
|---|---|---|
| 기본 Agentic loop (도구 호출 → 완료) | `AgentLoopE2ETests.RunAsync_ExecutesToolCall_AndCompletesWithFinalText` | ToolCall/ToolResult/Complete 이벤트가 순서상 유효하고 최종 응답에 계산 결과 포함 |
| unknown-tool 복구 | `AgentLoopE2ETests.RunAsync_UnknownTool_RecoversAndCompletes` | unknown 도구 오류 이벤트 후 완료까지 수렴, 반복 실패 루프 없음 |
| Plan Mode 실행 연결 | `AgentLoopE2ETests.RunAsync_PlanModeAlways_EmitsPlanningThenExecutesTool` | 계획 응답 후 실제 도구 호출이 이어지고 최종 결과 생성 |
| 권한 Ask 거부 처리 | `AgentLoopE2ETests.RunAsync_AskPermissionDenied_EmitsPermissionEvents_AndCompletes` | PermissionRequest/PermissionDenied 이벤트가 기록되고 안전 종료 |
| Hook 입력 변형 반영 | `AgentLoopE2ETests.RunAsync_PreHookInputMutation_ChangesToolArguments` | pre-hook `updatedInput`이 실제 도구 입력에 적용됨 |
| Runtime 정책(`allowed_tools`) 강제 | `AgentLoopE2ETests.RunAsync_DisallowedTool_ByRuntimePolicy_EmitsPolicyRecoveryError` | 비허용 도구 차단 + 정책 복구 경고 후 종료 |
| Hook filter 정합성 | `AgentLoopE2ETests.RunAsync_HookFilters_ExecuteOnlyMatchingHookForToolAndTiming` | 지정된 hook만 실행되고 비매칭 hook는 미실행 |
| OpenCode alias(`EnterPlanMode`) 정규화 | `AgentLoopE2ETests.RunAsync_EnterPlanModeAlias_ResolvesAndExecutes` | CamelCase 도구명이 AX 내부 snake_case 도구로 매핑되어 정상 실행 |
| 혼합 복구 내구성 (unknown + 권한 + 대체도구) | `AgentLoopE2ETests.RunAsync_MixedRecovery_UnknownToolAndPermissionDenied_TerminatesSafely` | unknown-tool 오류 후 file_write 경유, math_eval로 수렴하고 반복 한도 내 안전 종료 |
### 벤치마크 배포 체크리스트 연결
1. `dotnet build` 경고 0/오류 0.
2. `dotnet test` 전체 통과 (`374/374` 기준, 증가 시 최신 값으로 동기화).
3. 위 9개 시나리오의 회귀 테스트가 모두 통과.
4. 패리티 수치/상태를 `NEXT_ROADMAP.md`와 동일 문구로 동기화.
5. 릴리즈 전 게이트 스크립트 실행: `powershell -ExecutionPolicy Bypass -File .\scripts\release-gate.ps1`
### 실행 증적 (2026-04-03)
- `dotnet test --filter "Suite=ParityBenchmark"`: 12/12 통과.
- `powershell -ExecutionPolicy Bypass -File .\scripts\release-gate.ps1`: build/replay/full gate 통과.
## 13. 세션 Replay 안정성 기준 (고정)
| 시나리오 | 기준 테스트 | 합격 기준 |
|---|---|---|
| 실행 이벤트 정렬/압축 복원 | `ChatSessionStateServiceTests.LoadOrCreateConversation_NormalizesHistoryOrderAndCompactsSize` | ExecutionEvents 400개 상한 유지 + 시간순 정렬 유지 |
| run 이력 중복 정규화 | `ChatSessionStateServiceTests.LoadOrCreateConversation_NormalizesAgentRunDuplicatesByRunId` | 동일 `RunId` 중복이 최신 상태 1건으로 축약 |
| 동시각 이벤트 종결 우선 판정 | `TaskRunServiceTests.RestoreRecentFromExecutionEvents_PrefersTerminalEventsWhenTimestampsEqual` | Tool/Permission 상태가 terminal 이벤트 기준으로 복원 |
| 비종결 이벤트 active 복원 | `TaskRunServiceTests.RestoreRecentFromExecutionEvents_RebuildsActiveTasksFromNonTerminalEvents` | 중단 후 재개 시 active task 3종(agent/tool/permission) 재구성 |
| run 종료 시 dangling 정리 | `TaskRunServiceTests.RestoreRecentFromExecutionEvents_CompleteClearsDanglingRunScopedActiveTasks` | Complete 이후 run 스코프 active task 잔존 0건 |
| 현재 run 복원 우선순위 | `AppStateServiceTests.RestoreCurrentAgentRun_PrefersRunningExecutionEventOverHistory` | 실행 중 이벤트가 history보다 우선되어 현재 run 복원 |
| recent timeline 재구성 | `AppStateServiceTests.RestoreRecentTasks_RebuildsRecentTaskTimelineFromExecutionEvents` | 도구/권한/에이전트 최근 이력 순서 복원 |
| 권한 거부 후 active 권한 상태 정리 | `AppStateServiceTests.RestoreRecentTasks_PermissionDeniedLeavesNoActivePermissionAfterResume` | PermissionDenied 이후 run 재개 시 active permission 잔존 0건 |
| Hook 타임라인 역순 병합 정합성 | `AppStateServiceTests.ApplyAgentEvent_ReplaysHookTimelineInReverseChronologicalOrder` | Hook 이벤트가 역순 타임라인에서도 시간/의미 순서 보존 |
| 완료 이벤트 우선 정리(병렬 도구) | `TaskRunServiceTests.RestoreRecentFromExecutionEvents_CompleteClearsParallelToolCallsForSameRun` | Complete 도착 시 동일 run의 병렬 도구 active task 즉시 정리 |
### 운영 규칙
1. 위 시나리오는 `Suite=ReplayStability` 테스트 태그로 관리.
2. 릴리즈 전 `Suite=ReplayStability` 전건 통과를 replay 불일치 0건의 최소 조건으로 사용.
### 실행 증적 (2026-04-03)
- `dotnet test --filter "Suite=ReplayStability"`: 12/12 통과.
- `powershell -ExecutionPolicy Bypass -File .\scripts\release-gate.ps1`: `ReplayStability` 포함 게이트 통과.
## 14. 권한 Hook 계약 (P2 마감 기준)
- lifecycle hook 키:
- `__permission_request__` (pre)
- `__permission_granted__` (post)
- `__permission_denied__` (post)
- payload 기준 필드: `runId`, `tool`, `target`, `permission`, `granted`, `reason`.
- 우선순위:
1. Hook `updatedPermissions`가 현재 run의 `AgentContext.ToolPermissions`를 즉시 갱신.
2. 갱신 후 `context.CheckToolPermissionAsync()`로 최종 판정.
3. hook 실패/예외는 non-blocking(권한 흐름 지속).
4. `additionalContext`는 가능한 경로에서 메시지 컨텍스트로 반영.

View File

@@ -4,10 +4,10 @@ Generated: 2026-04-04 02:06:25
## Summary
- AX slash count: 85
- claw-code slash count: 7
- OpenCode slash count: 7
- Common: 7
- AX only: 78
- claw-code only: 0
- OpenCode only: 0
## Common
- /clear
@@ -98,8 +98,8 @@ Generated: 2026-04-04 02:06:25
- /verify
- /vim
## claw-code Only
## OpenCode Only
## Notes
- claw-code source baseline: claw-code/en/quickstart.md
- OpenCode source baseline: OpenCode/en/quickstart.md
- AX source baseline: src/AxCopilot/Views/ChatWindow.xaml.cs