컨텍스트는 claude-code식으로 유지하고 품질 강제는 AX 기준으로 복원한다

- 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
This commit is contained in:
2026-04-12 22:47:21 +09:00
parent da11029284
commit ecff76d9ac
6 changed files with 55 additions and 10 deletions

View File

@@ -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)
{

View File

@@ -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),
};
}

View File

@@ -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
{

View File

@@ -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.");
// 문서 품질 검증 루프