Public Access
Make meeting lifecycle stateful
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
using MeetingAssistant.MeetingNotes;
|
||||
using MeetingAssistant.Summary;
|
||||
using MeetingAssistant.Transcription;
|
||||
using Microsoft.Extensions.Options;
|
||||
|
||||
namespace MeetingAssistant.Tests;
|
||||
|
||||
@@ -55,6 +57,7 @@ public sealed class MeetingSummaryToolTests
|
||||
Assert.Contains("meeting: \"[[../Notes/meeting|Meeting Note]]\"", summary);
|
||||
Assert.Contains("transcript: \"[[../Transcripts/transcript|Transcript]]\"", summary);
|
||||
Assert.Contains("assistant_context: \"[[../Assistant Context/context|Assistant Context]]\"", summary);
|
||||
Assert.DoesNotContain("summary:", summary);
|
||||
Assert.Contains("# Summary\n\n- Done.", summary);
|
||||
}
|
||||
|
||||
@@ -142,4 +145,63 @@ public sealed class MeetingSummaryToolTests
|
||||
Assert.Contains("state: summarizing", context);
|
||||
Assert.Contains("replacement\ninserted\nline two", context);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExternalAgentWritesAreAppendedToAssistantContextAsDiffs()
|
||||
{
|
||||
var root = Path.Combine(Path.GetTempPath(), "meeting-assistant-tests", Guid.NewGuid().ToString("N"));
|
||||
var projectsRoot = Path.Combine(root, "Projects");
|
||||
var projectRoot = Path.Combine(projectsRoot, "MeetingAssistant");
|
||||
var projectFile = Path.Combine(projectRoot, "notes.md");
|
||||
var dictionaryPath = Path.Combine(root, "Meetings", "Dictionary.md");
|
||||
var artifacts = new MeetingSessionArtifacts(
|
||||
MeetingNotePath: Path.Combine(root, "Meetings", "Notes", "meeting.md"),
|
||||
TranscriptPath: Path.Combine(root, "Meetings", "Transcripts", "transcript.md"),
|
||||
AssistantContextPath: Path.Combine(root, "Meetings", "Assistant Context", "context.md"),
|
||||
SummaryPath: Path.Combine(root, "Meetings", "Summaries", "summary.md"));
|
||||
Directory.CreateDirectory(projectRoot);
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(artifacts.MeetingNotePath)!);
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(artifacts.AssistantContextPath)!);
|
||||
await File.WriteAllTextAsync(projectFile, "one\ntwo\nthree");
|
||||
await File.WriteAllTextAsync(
|
||||
artifacts.MeetingNotePath,
|
||||
"""
|
||||
---
|
||||
title: Meeting
|
||||
projects:
|
||||
- MeetingAssistant
|
||||
---
|
||||
""");
|
||||
await File.WriteAllTextAsync(artifacts.AssistantContextPath, "Context before.");
|
||||
var options = new MeetingAssistantOptions
|
||||
{
|
||||
Vault =
|
||||
{
|
||||
DictationWordsPath = dictionaryPath,
|
||||
ProjectsFolder = projectsRoot
|
||||
}
|
||||
};
|
||||
var audit = new SummaryAgentWriteAudit(artifacts);
|
||||
var tools = new MeetingSummaryTools(
|
||||
artifacts,
|
||||
options,
|
||||
new MarkdownDictationWordStore(Options.Create(options)),
|
||||
audit);
|
||||
|
||||
await tools.WriteContext("owned context");
|
||||
await tools.WriteSummary("owned summary");
|
||||
await tools.WriteProjectFile("MeetingAssistant", "notes.md", "TWO", from: 2, to: 2);
|
||||
await tools.AddDictationWord("PBI");
|
||||
await audit.AppendToAssistantContextAsync(CancellationToken.None);
|
||||
|
||||
var context = await File.ReadAllTextAsync(artifacts.AssistantContextPath);
|
||||
Assert.Contains("## Summary Agent External File Changes", context);
|
||||
Assert.Contains(projectFile, context);
|
||||
Assert.Contains("- two", context);
|
||||
Assert.Contains("+ TWO", context);
|
||||
Assert.Contains(dictionaryPath, context);
|
||||
Assert.Contains("+ - PBI", context);
|
||||
Assert.DoesNotContain("owned summary", context);
|
||||
Assert.DoesNotContain("- Context before.", context);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user