Add transcript line workflow rules
PR and Push Build/Test / build-and-test (push) Failing after 13m27s

This commit is contained in:
2026-06-03 11:24:11 +02:00
parent 50daa88389
commit 40853115c5
20 changed files with 627 additions and 70 deletions
@@ -4,11 +4,11 @@ namespace MeetingAssistant.Workflow;
internal static class MeetingWorkflowRulesValidator
{
private static readonly string[] SupportedTriggerKeys = ["created", "state_transition", "speaker_identified"];
private static readonly string[] SupportedTriggerKeys = ["created", "state_transition", "speaker_identified", "transcript_line"];
private static readonly string[] SupportedConditionKeys = ["condition", "and", "or", "not"];
private static readonly string[] SupportedStepUses =
["add_attendee", "remove_attendee", "add_project", "set_property", "add_context"];
private static readonly string[] SupportedSetPropertyNames = ["title", "meeting.title"];
private static readonly string[] SupportedSetPropertyNames = ["title", "meeting.title", "transcript.line"];
public static async Task<IReadOnlyList<string>> ValidateAsync(MeetingWorkflowRulesFile rulesFile)
{
@@ -43,6 +43,7 @@ internal static class MeetingWorkflowRulesValidator
{
await ValidateStepAsync(
rule.Steps[stepIndex],
rule,
ruleName,
stepIndex,
errors,
@@ -63,7 +64,8 @@ internal static class MeetingWorkflowRulesValidator
var configuredCount = CountConfigured(
trigger.Created is not null,
trigger.StateTransition is not null,
trigger.SpeakerIdentified is not null);
trigger.SpeakerIdentified is not null,
trigger.TranscriptLine is not null);
if (configuredCount == 0)
{
errors.Add($"{ruleName} on[{triggerIndex + 1}] must contain one supported trigger: {JoinAllowed(SupportedTriggerKeys)}.");
@@ -120,6 +122,7 @@ internal static class MeetingWorkflowRulesValidator
private static async Task ValidateStepAsync(
MeetingWorkflowStep step,
MeetingWorkflowRule rule,
string ruleName,
int stepIndex,
List<string> errors,
@@ -151,6 +154,11 @@ internal static class MeetingWorkflowRulesValidator
{
errors.Add($"{stepPath} uses unsupported property '{property}'. Supported properties: {JoinAllowed(SupportedSetPropertyNames)}.");
}
else if (string.Equals(property.Trim(), "transcript.line", StringComparison.OrdinalIgnoreCase) &&
!HasTranscriptLineTrigger(rule))
{
errors.Add($"{stepPath} can set 'transcript.line' only on rules with a transcript_line trigger.");
}
}
if (step.Value is { } value &&
@@ -174,6 +182,11 @@ internal static class MeetingWorkflowRulesValidator
: $"rule '{rule.Name}'";
}
private static bool HasTranscriptLineTrigger(MeetingWorkflowRule rule)
{
return rule.On.Any(static trigger => trigger.TranscriptLine is not null);
}
private static int CountConfigured(params bool[] values)
{
return values.Count(static value => value);
@@ -196,7 +209,10 @@ internal static class MeetingWorkflowRulesValidator
MeetingWorkflowEventType.StateTransition.ToString(),
MeetingWorkflowStateNames.ToRuleName(AssistantContextState.CollectingMetadata),
MeetingWorkflowStateNames.ToRuleName(AssistantContextState.Transcribing)),
new MeetingWorkflowSpeakerModel("Ada Lovelace"));
new MeetingWorkflowSpeakerModel("Ada Lovelace"),
new MeetingWorkflowTranscriptModel(
"[00:00:01] Ada Lovelace: Validation line.",
"Ada Lovelace"));
}
private static string FormatRazorValidationMessage(Exception exception)