From ecff76d9acd1e4b6019e748feff1863a7b40ef11 Mon Sep 17 00:00:00 2001 From: lacvet Date: Sun, 12 Apr 2026 22:47:21 +0900 Subject: [PATCH] =?UTF-8?q?=EC=BB=A8=ED=85=8D=EC=8A=A4=ED=8A=B8=EB=8A=94?= =?UTF-8?q?=20claude-code=EC=8B=9D=EC=9C=BC=EB=A1=9C=20=EC=9C=A0=EC=A7=80?= =?UTF-8?q?=ED=95=98=EA=B3=A0=20=ED=92=88=EC=A7=88=20=EA=B0=95=EC=A0=9C?= =?UTF-8?q?=EB=8A=94=20AX=20=EA=B8=B0=EC=A4=80=EC=9C=BC=EB=A1=9C=20?= =?UTF-8?q?=EB=B3=B5=EC=9B=90=ED=95=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Cowork 문서 생성 가이드에 richer section pattern과 생성 후 점검 요약을 다시 넣어 단조로운 문서와 빈약한 최종 요약을 보강 - docs 태스크 최종 보고 프롬프트를 별도 분기해 출력 파일 경로, 핵심 섹션, 구성 규모, 생성 후 확인 사항을 다시 강하게 요구 - balanced/reasoning_first/document_heavy 프로필에서 문서 검증 게이트와 최종 보고 게이트를 복원해 품질 강제를 AX 기준으로 유지 - 검증: dotnet build src/AxCopilot/AxCopilot.csproj -c Release -v minimal -p:OutputPath=bin\\verify\\ -p:IntermediateOutputPath=obj\\verify\\ 경고 0 / 오류 0 --- README.md | 7 ++++++ docs/DEVELOPMENT.md | 9 ++++++++ .../Services/Agent/AgentLoopService.cs | 23 +++++++++++++++++++ .../Agent/ModelExecutionProfileCatalog.cs | 18 +++++++-------- .../Services/Agent/TaskTypePolicy.cs | 4 +++- .../Views/ChatWindow.SystemPromptBuilder.cs | 4 ++++ 6 files changed, 55 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index ff05cab..1d304fc 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,13 @@ Windows 전용 시맨틱 런처 & 워크스페이스 매니저 개발 참고: Claw Code 동등성 작업 추적 문서 `docs/claw-code-parity-plan.md` +- 업데이트: 2026-04-12 23:58 (KST) +- Cowork 문서 생성이 단조로워지고 마지막 요약이 약해진 부분을 다시 보강했습니다. 문서 태스크 가이드에 반복적인 동일 패턴 섹션 작성을 피하고, 목적에 따라 요약/핵심 발견/비교표/타임라인/권고안/부록 같은 richer section pattern을 쓰도록 다시 유도했습니다. +- Cowork 시스템 프롬프트도 같은 기준으로 조정했습니다. 새 문서 생성 시 filler paragraph 대신 bullets, tables, structured comparison을 적극적으로 쓰게 하고, 최종 응답에는 생성 후 점검 항목까지 포함한 구조화 요약을 남기도록 복원했습니다. +- 문서형 최종 보고는 `simple`에서도 출력 파일 경로와 핵심 섹션을 남기고, `balanced/rich`에서는 문서 유형, 출력 경로, 핵심 섹션, 분량/구성 규모, 생성 후 확인 사항까지 요약하도록 다시 강화했습니다. +- 실행 프로필도 AX 품질 기준으로 일부 되돌렸습니다. `balanced`, `reasoning_first`, `document_heavy`는 문서 검증 게이트와 최종 보고 재정리 게이트를 다시 활성화해, 컨텍스트 관리만 `claude-code`에 맞추고 품질 강제는 AX 쪽 기준을 유지하도록 조정했습니다. +- 검증: `dotnet build src/AxCopilot/AxCopilot.csproj -c Release -v minimal -p:OutputPath=bin\\verify\\ -p:IntermediateOutputPath=obj\\verify\\` 경고 0 / 오류 0 + - 업데이트: 2026-04-12 23:45 (KST) - `claude-code` 기준으로 남아 있던 provider/compact/UI 후속 차이를 더 줄였습니다. OpenAI 호환 도구 호출은 이제 모델 계열별 호환 프로파일을 적용해 Qwen·LLaMA·DeepSeek 같은 취약한 vLLM 계열에서 최근 structured tool history 범위를 더 좁히고, 병렬 tool call과 reasoning_effort도 더 보수적으로 전송합니다. - tool forcing fallback도 보강했습니다. IBM 배포형뿐 아니라 일반 OpenAI 호환 경로에서도 `tool_choice`가 400으로 거부되면, plain text 지시를 덧붙인 대체 요청으로 한 번 더 재시도해 `채팅은 되지만 Cowork/Code만 막히는` 조합을 줄였습니다. diff --git a/docs/DEVELOPMENT.md b/docs/DEVELOPMENT.md index e5803ff..c11be60 100644 --- a/docs/DEVELOPMENT.md +++ b/docs/DEVELOPMENT.md @@ -734,6 +734,15 @@ owKindCounts를 함께 남겨 %APPDATA%\\AxCopilot\\perf 기준으로 transcript - compact 뒤 첫 LLM 호출이 복원된 맥락의 종류를 더 안정적으로 전달받습니다. - transcript와 usage UI가 `claw-code`처럼 더 얇고 조용한 운영 메타 표현을 유지합니다. +## Cowork 문서 생성 다양성/최종 요약 보강 + +- 업데이트: 2026-04-12 23:58 (KST) +- `TaskTypePolicy`의 docs 가이드를 다시 강화했습니다. 새 문서 작성 시 flat하고 반복적인 섹션 구성을 피하고, 목적에 따라 요약/발견/비교표/타임라인/권고안/부록 같은 richer section pattern을 적극적으로 쓰도록 유도합니다. +- `AgentLoopService.BuildFinalReportQualityPrompt`는 docs 태스크를 별도 분기합니다. `simple`도 출력 파일 경로와 핵심 섹션을 남기고, `balanced/rich`는 문서 종류, 출력 경로, 핵심 섹션 3~6개, 분량/구성 규모, 생성 후 확인 사항까지 요약하도록 복원했습니다. +- `ChatWindow.SystemPromptBuilder`는 Cowork 시스템 프롬프트에 richer document composition 가이드를 다시 넣었습니다. filler paragraph를 줄이고 bullets/tables/structured comparison을 더 적극적으로 쓰게 하며, 최종 completion summary에 생성 후 점검 항목을 포함하도록 했습니다. +- `ModelExecutionProfileCatalog`는 품질 강제를 다시 살렸습니다. `balanced`, `reasoning_first`, `document_heavy` 프로필에서 `EnableDocumentVerificationGate`, `DocumentVerificationGateMaxRetries`, `FinalReportGateMaxRetries`를 복원해 문서 생성 후 검증 근거와 최종 보고 품질을 다시 AX 기준으로 유지합니다. +- 검증: `dotnet build src/AxCopilot/AxCopilot.csproj -c Release -v minimal -p:OutputPath=bin\\verify\\ -p:IntermediateOutputPath=obj\\verify\\` 경고 0 / 오류 0 + ## claude-code식 provider/compact/UI 후속 정렬 - 업데이트: 2026-04-12 23:45 (KST) diff --git a/src/AxCopilot/Services/Agent/AgentLoopService.cs b/src/AxCopilot/Services/Agent/AgentLoopService.cs index 8e91b06..457aa1f 100644 --- a/src/AxCopilot/Services/Agent/AgentLoopService.cs +++ b/src/AxCopilot/Services/Agent/AgentLoopService.cs @@ -3532,6 +3532,29 @@ public partial class AgentLoopService private static string BuildFinalReportQualityPrompt(TaskTypePolicy taskPolicy, bool highImpact) { var expressionLevel = GetAgentUiExpressionLevel(); + var isDocumentTask = string.Equals(taskPolicy.TaskType, "docs", StringComparison.OrdinalIgnoreCase); + + if (isDocumentTask && expressionLevel == "simple") + { + return "[System:FinalReportQuality] 최종 답변을 짧게 정리하세요.\n" + + "1. 어떤 문서 또는 산출물을 만들었는지\n" + + "2. 실제 출력 파일 경로\n" + + "3. 핵심 섹션 또는 내용 2~4개\n" + + "4. 확인한 사항 한 줄\n" + + "불필요한 메타 설명은 쓰지 마세요."; + } + + if (isDocumentTask) + { + return "[System:FinalReportQuality] 문서 작업 최종 답변을 한눈에 이해되게 정리하세요.\n" + + "1. 작업 유형 또는 문서 종류\n" + + "2. 실제 출력 파일 경로\n" + + "3. 핵심 섹션/장/표/분석 포인트를 3~6개로 요약\n" + + "4. 문서 분량 또는 대략적인 구성 규모\n" + + "5. 생성 후 무엇을 검토하거나 확인했는지\n" + + "6. 실제 미해결 이슈가 있을 때만 마지막에 짧게 적기\n" + + "사용자가 파일을 열지 않아도 내용이 떠오를 만큼 구체적으로 쓰되, 장황한 메타 설명은 피하세요."; + } if (expressionLevel == "simple" && !taskPolicy.IsReviewTask && !highImpact) { diff --git a/src/AxCopilot/Services/Agent/ModelExecutionProfileCatalog.cs b/src/AxCopilot/Services/Agent/ModelExecutionProfileCatalog.cs index 21ef62d..cdb5ea0 100644 --- a/src/AxCopilot/Services/Agent/ModelExecutionProfileCatalog.cs +++ b/src/AxCopilot/Services/Agent/ModelExecutionProfileCatalog.cs @@ -89,16 +89,16 @@ public static class ModelExecutionProfileCatalog ReduceEarlyMemoryPressure: false, EnablePostToolVerification: false, EnableCodeQualityGates: true, - EnableDocumentVerificationGate: false, + EnableDocumentVerificationGate: true, EnableParallelReadBatch: true, MaxParallelReadBatch: 6, CodeVerificationGateMaxRetries: 1, HighImpactBuildTestGateMaxRetries: 1, - FinalReportGateMaxRetries: 0, + FinalReportGateMaxRetries: 1, CodeDiffGateMaxRetries: 0, RecentExecutionGateMaxRetries: 0, ExecutionSuccessGateMaxRetries: 0, - DocumentVerificationGateMaxRetries: 0, + DocumentVerificationGateMaxRetries: 1, TerminalEvidenceGateMaxRetries: 1), "fast_readonly" => new ExecutionPolicy( "fast_readonly", @@ -139,16 +139,16 @@ public static class ModelExecutionProfileCatalog ReduceEarlyMemoryPressure: true, EnablePostToolVerification: false, EnableCodeQualityGates: false, - EnableDocumentVerificationGate: false, + EnableDocumentVerificationGate: true, EnableParallelReadBatch: true, MaxParallelReadBatch: 6, CodeVerificationGateMaxRetries: 0, HighImpactBuildTestGateMaxRetries: 0, - FinalReportGateMaxRetries: 0, + FinalReportGateMaxRetries: 1, CodeDiffGateMaxRetries: 0, RecentExecutionGateMaxRetries: 0, ExecutionSuccessGateMaxRetries: 0, - DocumentVerificationGateMaxRetries: 0, + DocumentVerificationGateMaxRetries: 1, TerminalEvidenceGateMaxRetries: 1), _ => new ExecutionPolicy( "balanced", @@ -164,16 +164,16 @@ public static class ModelExecutionProfileCatalog ReduceEarlyMemoryPressure: false, EnablePostToolVerification: false, EnableCodeQualityGates: true, - EnableDocumentVerificationGate: false, + EnableDocumentVerificationGate: true, EnableParallelReadBatch: true, MaxParallelReadBatch: 6, CodeVerificationGateMaxRetries: 1, HighImpactBuildTestGateMaxRetries: 1, - FinalReportGateMaxRetries: 0, + FinalReportGateMaxRetries: 1, CodeDiffGateMaxRetries: 0, RecentExecutionGateMaxRetries: 0, ExecutionSuccessGateMaxRetries: 0, - DocumentVerificationGateMaxRetries: 0, + DocumentVerificationGateMaxRetries: 1, TerminalEvidenceGateMaxRetries: 1), }; } diff --git a/src/AxCopilot/Services/Agent/TaskTypePolicy.cs b/src/AxCopilot/Services/Agent/TaskTypePolicy.cs index 5a898f3..efee014 100644 --- a/src/AxCopilot/Services/Agent/TaskTypePolicy.cs +++ b/src/AxCopilot/Services/Agent/TaskTypePolicy.cs @@ -71,13 +71,15 @@ internal sealed class TaskTypePolicy "[System:TaskType] This is a document/content task. " + "If the user asks you to create or write a new document, skip file exploration entirely and go directly to the creation tool (docx_create, html_create, excel_create, etc.). " + "Use document_plan only when it materially helps structure a multi-section document. " + + "Avoid flat, repetitive section writing. Match the structure to the user's purpose and vary the shape with summaries, findings, tables, comparisons, timelines, action items, or appendices when useful. " + + "Prefer concrete and business-ready content over generic filler paragraphs. " + "Prefer producing a real file on disk when the request is clearly for a deliverable, but do not force file creation for analysis-only or advisory requests. " + "If the user asks you to read or analyze existing documents, use: glob/grep -> document_read/file_read -> analysis. " + "Use folder_map only when the user explicitly asks for folder contents or directory structure.", FailurePatternFocus = "Check source evidence and document completeness first.", FollowUpTaskLine = "", FailureInvestigationTaskLine = "", - FinalReportTaskLine = "", + FinalReportTaskLine = "For document tasks, include output path, document type, key sections with one-line descriptions, and what was checked after generation.\n", }, _ => new TaskTypePolicy { diff --git a/src/AxCopilot/Views/ChatWindow.SystemPromptBuilder.cs b/src/AxCopilot/Views/ChatWindow.SystemPromptBuilder.cs index 1199542..c2809b6 100644 --- a/src/AxCopilot/Views/ChatWindow.SystemPromptBuilder.cs +++ b/src/AxCopilot/Views/ChatWindow.SystemPromptBuilder.cs @@ -65,6 +65,8 @@ public partial class ChatWindow sb.AppendLine("For ordinary Cowork requests where no plan is requested, proceed directly with the work and focus on producing the requested result."); sb.AppendLine("If the user asks for a brand-new report, proposal, analysis, manual, or other document and does not explicitly ask to reference workspace files, do NOT start with glob, grep, document_read, or folder_map."); sb.AppendLine("In that case, go straight to the creation tool. Use document_plan only when multi-section structure work clearly improves the result or when the user explicitly requests a plan."); + sb.AppendLine("When writing a new document, avoid repetitive same-shape sections. Tailor the structure to the purpose and use summaries, findings, comparison tables, timelines, recommendations, appendices, or action items when they improve clarity."); + sb.AppendLine("Prefer concrete and useful content over filler. If a section benefits from bullets, tables, or structured comparison, use them instead of flat generic paragraphs."); sb.AppendLine("After creating files, summarize what was created and include the actual output path."); sb.AppendLine("IMPORTANT: In your FINAL response after ALL work is done, provide a structured completion summary in this format:"); sb.AppendLine(" - 작업 유형: (e.g., report/analysis/proposal)"); @@ -72,6 +74,7 @@ public partial class ChatWindow sb.AppendLine(" - 주요 섹션: list key sections/chapters with brief description"); sb.AppendLine(" - 분량: page count, word count estimate"); sb.AppendLine(" - 사용 도구: tools used during creation"); + sb.AppendLine(" - verification: what you checked after generation (section completeness, placeholders, formatting, dates, etc.)"); sb.AppendLine("The user wants to see what the document contains at a glance without opening the file."); sb.AppendLine("Do not stop after a single step. Continue autonomously until the request is completed or a concrete blocker (permission denial, missing dependency, hard error) is encountered."); sb.AppendLine("When adapting external references, rewrite names/structure/comments to AX Copilot style. Avoid clone-like outputs."); @@ -81,6 +84,7 @@ public partial class ChatWindow sb.AppendLine(" 2. Use document_plan only when multi-section structure work clearly improves the result or when the user explicitly asks for a plan. When the user requests a plan, present it for approval before proceeding."); sb.AppendLine(" 3. Then immediately create the real output file with html_create, docx_create, markdown_create, or file_write."); sb.AppendLine(" 4. Fill every section with real content. Do not stop at an outline or plan only."); + sb.AppendLine(" 4-1. Use richer section patterns when they help: summary box, key findings bullets, comparison table, timeline, checklist, action items, appendix."); sb.AppendLine(" 5. The task is complete only after the actual document file has been created or updated."); // 문서 품질 검증 루프