- Cowork 프롬프트와 direct-creation 탐색 정책에서 PPT 요청은 document_plan을 무조건 선행하지 않고 pptx_create를 우선하도록 조정했습니다. - DeckPlanningService에 RefineForQuality 루프를 추가해 executive summary, comparison, roadmap, chart, KPI dashboard 슬라이드의 headline, takeaway, verdict, timeline/owner, KPI narrative를 자동 보강하도록 했습니다. - PptxSkill이 초기 deck review가 약할 때 한 번 더 refined deck을 만들고 실제로 점수와 경고가 개선된 경우에만 최종 렌더링에 반영하도록 수정했습니다. - DeckPlanningServiceTests와 PptxSkillAutoRepairTests를 확장해 generic PPT 품질 보정 회귀를 고정했습니다. - 검증: dotnet build src/AxCopilot/AxCopilot.csproj -c Release -v minimal -p:OutputPath=bin\\verify_ppt_generic_quality\\ -p:IntermediateOutputPath=obj\\verify_ppt_generic_quality\\ (경고 0 / 오류 0) - 검증: deck planning, pptx auto repair, golden deck, deck quality review 테스트 통과 14
166 lines
5.5 KiB
C#
166 lines
5.5 KiB
C#
using System.IO;
|
|
using System.Text.Json;
|
|
using AxCopilot.Services.Agent;
|
|
using DocumentFormat.OpenXml.Packaging;
|
|
using FluentAssertions;
|
|
using Xunit;
|
|
|
|
namespace AxCopilot.Tests.Services;
|
|
|
|
public class PptxSkillAutoRepairTests
|
|
{
|
|
[Fact]
|
|
public async Task ExecuteAsync_ShouldAugmentDeckAndReturnQualitySummary()
|
|
{
|
|
var workDir = Path.Combine(Path.GetTempPath(), "ax-pptx-repair-" + Guid.NewGuid().ToString("N"));
|
|
Directory.CreateDirectory(workDir);
|
|
|
|
try
|
|
{
|
|
var context = new AgentContext
|
|
{
|
|
WorkFolder = workDir,
|
|
Permission = "Auto",
|
|
OperationMode = "external",
|
|
};
|
|
|
|
var tool = new PptxSkill();
|
|
var args = JsonDocument.Parse(
|
|
"""
|
|
{
|
|
"path": "auto-repair-deck.pptx",
|
|
"title": "Operating Improvement",
|
|
"objective": "operating model proposal",
|
|
"decision_ask": "approve phase-1 launch",
|
|
"slides": [
|
|
{
|
|
"layout": "before_after",
|
|
"title": "Current vs Future",
|
|
"before": ["Manual coordination", "Slow approvals", "Fragmented KPI tracking"],
|
|
"after": ["Standard workflow", "Faster approvals", "Single KPI view"]
|
|
},
|
|
{
|
|
"layout": "benefit_waterfall",
|
|
"title": "Benefits",
|
|
"benefits": [
|
|
{ "label": "Cost", "value": 8 },
|
|
{ "label": "Speed", "value": 12 },
|
|
{ "label": "Quality", "value": 6 }
|
|
]
|
|
}
|
|
]
|
|
}
|
|
""").RootElement;
|
|
|
|
var result = await tool.ExecuteAsync(args, context, CancellationToken.None);
|
|
var outputPath = Path.Combine(workDir, "auto-repair-deck.pptx");
|
|
|
|
result.Success.Should().BeTrue();
|
|
result.Output.Should().Contain("PPT quality");
|
|
result.Output.Should().Contain("Storyline:");
|
|
File.Exists(outputPath).Should().BeTrue();
|
|
|
|
using var doc = PresentationDocument.Open(outputPath, false);
|
|
doc.PresentationPart!.Presentation.SlideIdList!.Count().Should().BeGreaterThanOrEqualTo(6);
|
|
}
|
|
finally
|
|
{
|
|
try
|
|
{
|
|
if (Directory.Exists(workDir))
|
|
Directory.Delete(workDir, true);
|
|
}
|
|
catch
|
|
{
|
|
}
|
|
}
|
|
}
|
|
|
|
[Fact]
|
|
public async Task ExecuteAsync_ShouldRefineWeakDeckBeforeExport()
|
|
{
|
|
var workDir = Path.Combine(Path.GetTempPath(), "ax-pptx-refine-" + Guid.NewGuid().ToString("N"));
|
|
Directory.CreateDirectory(workDir);
|
|
|
|
try
|
|
{
|
|
var context = new AgentContext
|
|
{
|
|
WorkFolder = workDir,
|
|
Permission = "Auto",
|
|
OperationMode = "external",
|
|
};
|
|
|
|
var tool = new PptxSkill();
|
|
var args = JsonDocument.Parse(
|
|
"""
|
|
{
|
|
"path": "refined-deck.pptx",
|
|
"title": "Quarterly Steering Deck",
|
|
"objective": "approve the next delivery wave",
|
|
"slides": [
|
|
{
|
|
"layout": "executive_summary",
|
|
"title": "Executive Summary",
|
|
"body": [
|
|
"Approve the next delivery wave",
|
|
"The delivery plan should move forward"
|
|
]
|
|
},
|
|
{
|
|
"layout": "comparison",
|
|
"title": "Options",
|
|
"options": [
|
|
{ "name": "Conservative" },
|
|
{ "name": "Balanced" }
|
|
]
|
|
},
|
|
{
|
|
"layout": "roadmap",
|
|
"title": "Roadmap",
|
|
"phases": [
|
|
{ "title": "Kickoff", "owner": "담당 미정" }
|
|
]
|
|
},
|
|
{
|
|
"layout": "chart",
|
|
"title": "Trend",
|
|
"chart_labels": ["Jan", "Feb", "Mar"],
|
|
"chart_values": [10, 13, 16]
|
|
},
|
|
{
|
|
"layout": "kpi_dashboard",
|
|
"title": "KPI Snapshot",
|
|
"kpis": [
|
|
{ "label": "Revenue", "value": "+9%" },
|
|
{ "label": "Cycle Time", "value": "-6%" },
|
|
{ "label": "Stability", "value": "96%" }
|
|
]
|
|
}
|
|
]
|
|
}
|
|
""").RootElement;
|
|
|
|
var result = await tool.ExecuteAsync(args, context, CancellationToken.None);
|
|
|
|
result.Success.Should().BeTrue();
|
|
result.Output.Should().Contain("PPT quality");
|
|
result.Output.Should().Contain("Needs work: none");
|
|
result.Output.Should().Contain("Auto-repair:");
|
|
File.Exists(Path.Combine(workDir, "refined-deck.pptx")).Should().BeTrue();
|
|
}
|
|
finally
|
|
{
|
|
try
|
|
{
|
|
if (Directory.Exists(workDir))
|
|
Directory.Delete(workDir, true);
|
|
}
|
|
catch
|
|
{
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|