코워크 문서 생성 게이트와 코드 후속 검증 게이트를 claw-code 기준으로 경량화

- balanced/tool_call_strict 프로필의 document_plan 재시도와 공격적 문서 fallback 개입을 줄여 Cowork 루프를 더 얇게 정리함

- document_plan 성공 직후 강제 user follow-up 주입을 제거하고 terminal 문서 도구 성공 시 Cowork에서 바로 종료할 수 있게 조정함

- CodeDiffGate, RecentExecutionGate, ExecutionSuccessGate를 review 작업 중심으로 제한해 일반 코드 수정의 과검증을 완화함

- TaskTypePolicy, SystemPromptBuilder, cowork preset을 함께 맞춰 문서 생성/분석형 요청의 종료 조건을 일관되게 정리함

- README.md 및 docs/DEVELOPMENT.md를 2026-04-12 23:05 (KST) 기준으로 갱신함

- 검증: dotnet build src/AxCopilot/AxCopilot.csproj -c Release -v minimal -p:OutputPath=bin\\verify\\ -p:IntermediateOutputPath=obj\\verify\\ (경고 0, 오류 0)
This commit is contained in:
2026-04-12 22:15:26 +09:00
parent fb0bea41f7
commit 4db75d46cd
10 changed files with 86 additions and 54 deletions

View File

@@ -600,7 +600,10 @@ public partial class AgentLoopService
}
// ── 2단계: document_plan 직접 생성 폴백 ──
if (documentPlanCalled && !string.IsNullOrEmpty(documentPlanScaffold) && !_docFallbackAttempted)
if (executionPolicy.PreferAggressiveDocumentFallback
&& documentPlanCalled
&& !string.IsNullOrEmpty(documentPlanScaffold)
&& !_docFallbackAttempted)
{
_docFallbackAttempted = true;
EmitEvent(AgentEventType.Thinking, "", "앱에서 직접 문서를 생성합니다...");
@@ -870,6 +873,7 @@ public partial class AgentLoopService
// document_plan은 호출됐지만 terminal 문서 도구(html_create 등)가 미호출인 경우 → 프로파일 기준 재시도
if (requiresConcreteArtifactOrEdit
&& executionPolicy.DocumentPlanRetryMax > 0
&& documentPlanCalled && postDocumentPlanRetry < documentPlanRetryMax)
{
postDocumentPlanRetry++;
@@ -886,6 +890,7 @@ public partial class AgentLoopService
// 재시도도 모두 소진 → 앱이 직접 본문 생성 후 html_create 강제 실행
if (requiresConcreteArtifactOrEdit
&& executionPolicy.PreferAggressiveDocumentFallback
&& documentPlanCalled && !string.IsNullOrEmpty(documentPlanScaffold) && !_docFallbackAttempted)
{
_docFallbackAttempted = true;
@@ -949,7 +954,8 @@ public partial class AgentLoopService
// LLM이 도구를 한 번도 호출하지 않고 텍스트만 반환 + 문서 생성 요청이면 → 앱이 직접 HTML 파일로 저장
// 주의: 이미 도구가 실행된 경우(totalToolCalls > 0)에는 폴백하지 않음 (중복 파일 방지)
if (!_docFallbackAttempted && totalToolCalls == 0
if (executionPolicy.PreferAggressiveDocumentFallback
&& !_docFallbackAttempted && totalToolCalls == 0
&& !string.IsNullOrEmpty(textResponse)
&& IsDocumentCreationRequest(userQuery))
{
@@ -986,6 +992,7 @@ public partial class AgentLoopService
if (TryApplyCodeDiffEvidenceGateTransition(
messages,
textResponse,
taskPolicy,
runState,
executionPolicy))
continue;