?? planner/assembler ??? 2? ??

?? ??:
- Word/HTML/Excel ?? ?? ??? PPT ??? planner ?? ??? ? ??? ??? ?? ?? ??? ?????.
- ??? ???? document_plan ???? ?? ??? ? ??? xlsx scaffold ??? ?????.

?? ????:
- DocumentPlannerTool? format:xlsx ??? ???? summary_sheet + sheets ??? excel_create scaffold? ????? ??????.
- DocumentPlannerTool? ?? ?? ??? workbook/tracker/dashboard/scorecard ???? ????? ??????.
- DocumentAssemblerTool? DOCX ?? ??? cover_subtitle, TOC, header/footer ??? ???? ?? ???? DOCX ?? ?? ??? ??????.
- DocumentAssemblerTool? HTML ?? ??? ArtifactQualityReviewService? ??? score ?? ?? ??? ????? ??????.
- kpi-workbook ???? document_plan ??? ??? complex workbook ?? ? planner ??? ??? ? ?? ????.
- ?? ?? ???? DocumentPlannerWorkbookScaffoldTests, DocumentAssemblerDocxFeaturesTests? ??????.
- README.md? docs/DEVELOPMENT.md? 2026-04-14 22:14 (KST) ?? ?? ??? ??????.

?? ??:
- dotnet build src/AxCopilot/AxCopilot.csproj -c Release -v minimal -p:OutputPath=bin\\verify_doc_planning2\\ -p:IntermediateOutputPath=obj\\verify_doc_planning2\\ : ?? 0 / ?? 0
- dotnet test src/AxCopilot.Tests/AxCopilot.Tests.csproj -c Release -v minimal --filter "DocumentPlannerWorkbookScaffoldTests|DocumentAssemblerDocxFeaturesTests|DocumentAssemblerSemanticTests|DocumentPlannerBusinessDocumentTests|ExcelSkillExecutiveSummaryLinkTests|HtmlSkillConsultingSectionsTests|DocxSkillTemplateFeaturesTests" -p:OutputPath=bin\\verify_doc_planning_tests3\\ -p:IntermediateOutputPath=obj\\verify_doc_planning_tests3\\ : ?? 7
This commit is contained in:
2026-04-14 22:15:50 +09:00
parent 8571a83ed0
commit 1ad5eea32e
7 changed files with 633 additions and 59 deletions

View File

@@ -0,0 +1,75 @@
using System.IO;
using System.Text.Json;
using AxCopilot.Services.Agent;
using DocumentFormat.OpenXml.Packaging;
using DocumentFormat.OpenXml.Wordprocessing;
using FluentAssertions;
using Xunit;
namespace AxCopilot.Tests.Services;
public class DocumentAssemblerDocxFeaturesTests
{
[Fact]
public async Task ExecuteAsync_ForDocx_ShouldIncludeCoverTocHeaderAndFooter()
{
var workDir = Path.Combine(Path.GetTempPath(), "ax-doc-assemble-features-" + Guid.NewGuid().ToString("N"));
Directory.CreateDirectory(workDir);
try
{
var tool = new DocumentAssemblerTool();
var context = new AgentContext
{
WorkFolder = workDir,
Permission = "Auto",
OperationMode = "external",
};
var args = JsonDocument.Parse(
"""
{
"path": "assembled-features.docx",
"title": "Operating Review",
"format": "docx",
"toc": true,
"cover_subtitle": "Q2 Steering Committee",
"header": "Internal Use Only",
"footer": "AX Copilot {page}",
"sections": [
{ "heading": "1. Executive Summary", "level": 1, "content": "<p>Summary.</p>" },
{ "heading": "2. Current State", "level": 1, "content": "<ul><li>Finding A</li><li>Finding B</li></ul>" },
{ "heading": "3. Recommendation", "level": 1, "content": "<div class=\"callout-info\"><strong>Decision</strong><p>Approve phase 1.</p></div>" },
{ "heading": "4. Appendix", "level": 1, "content": "<table><tr><th>Metric</th><th>Value</th></tr><tr><td>NPS</td><td>61</td></tr></table>" }
]
}
""").RootElement;
var result = await tool.ExecuteAsync(args, context, CancellationToken.None);
result.Success.Should().BeTrue();
result.Output.Should().Contain("DOCX 품질 리뷰");
var outputPath = Path.Combine(workDir, "assembled-features.docx");
File.Exists(outputPath).Should().BeTrue();
using var doc = WordprocessingDocument.Open(outputPath, false);
doc.MainDocumentPart.Should().NotBeNull();
doc.MainDocumentPart!.HeaderParts.Should().NotBeEmpty();
doc.MainDocumentPart.FooterParts.Should().NotBeEmpty();
doc.MainDocumentPart.Document.Body!.InnerText.Should().Contain("Q2 Steering Committee");
doc.MainDocumentPart.Document.Body.Descendants<FieldCode>().Should().Contain(field => field.Text.Contains("TOC"));
}
finally
{
try
{
if (Directory.Exists(workDir))
Directory.Delete(workDir, true);
}
catch
{
}
}
}
}

View File

@@ -0,0 +1,41 @@
using System.IO;
using System.Text.Json;
using AxCopilot.Services.Agent;
using FluentAssertions;
using Xunit;
namespace AxCopilot.Tests.Services;
public class DocumentPlannerWorkbookScaffoldTests
{
[Fact]
public async Task ExecuteAsync_ForXlsxFormat_ShouldReturnWorkbookScaffold()
{
var tool = new DocumentPlannerTool();
var context = new AgentContext
{
WorkFolder = Path.GetTempPath(),
Permission = "Auto",
OperationMode = "external",
};
var args = JsonDocument.Parse(
"""
{
"topic": "2026 KPI operating review",
"document_type": "analysis",
"format": "xlsx",
"target_pages": 6
}
""").RootElement;
var result = await tool.ExecuteAsync(args, context, CancellationToken.None);
result.Success.Should().BeTrue();
result.Output.Should().Contain("excel_create");
result.Output.Should().Contain("\"summary_sheet\"");
result.Output.Should().Contain("\"sheets\"");
result.Output.Should().Contain("Metrics");
result.Output.Should().Contain("Actions");
}
}