diff --git a/MeetingAssistant.Tests/AudioMixingTests.cs b/MeetingAssistant.Tests/AudioMixingTests.cs index 4c97fdf..71517fb 100644 --- a/MeetingAssistant.Tests/AudioMixingTests.cs +++ b/MeetingAssistant.Tests/AudioMixingTests.cs @@ -58,14 +58,21 @@ public sealed class AudioMixingTests [Fact] public async Task CompositeAudioSourceWaitsForMatchingStreamsBeforeMixing() { - var microphone = new DelayedAudioSource(TimeSpan.Zero, Pcm16(2_000)); - var system = new DelayedAudioSource(TimeSpan.FromMilliseconds(100), Pcm16(10_000)); + var microphone = new ControlledAudioSource(Pcm16(2_000)); + var system = new ControlledAudioSource(Pcm16(10_000)); var source = CreateSource(microphone, system); + using var cancellation = new CancellationTokenSource(TimeSpan.FromSeconds(5)); + await using var chunks = source.CaptureAsync(cancellation.Token).GetAsyncEnumerator(cancellation.Token); + var nextChunk = chunks.MoveNextAsync().AsTask(); - var chunks = await ReadChunks(source); + microphone.Release(); + await microphone.WaitUntilDeliveredAsync(); + Assert.False(nextChunk.IsCompleted); - var chunk = Assert.Single(chunks); - Assert.Equal(12_000, BitConverter.ToInt16(chunk.Pcm)); + system.Release(); + Assert.True(await nextChunk); + Assert.Equal(12_000, BitConverter.ToInt16(chunks.Current.Pcm)); + Assert.False(await chunks.MoveNextAsync()); } [Fact] @@ -187,6 +194,30 @@ public sealed class AudioMixingTests } } + private sealed class ControlledAudioSource : IMeetingAudioSource + { + private readonly AudioChunk chunk; + private readonly TaskCompletionSource release = new(TaskCreationOptions.RunContinuationsAsynchronously); + private readonly TaskCompletionSource delivered = new(TaskCreationOptions.RunContinuationsAsynchronously); + + public ControlledAudioSource(byte[] pcm) + { + chunk = new AudioChunk(pcm, 16000, 1); + } + + public void Release() => release.TrySetResult(); + + public Task WaitUntilDeliveredAsync() => delivered.Task.WaitAsync(TimeSpan.FromSeconds(5)); + + public async IAsyncEnumerable CaptureAsync( + [System.Runtime.CompilerServices.EnumeratorCancellation] CancellationToken cancellationToken) + { + await release.Task.WaitAsync(cancellationToken); + yield return chunk; + delivered.TrySetResult(); + } + } + private sealed class DelayedAudioSource : IMeetingAudioSource { private readonly TimeSpan delay; diff --git a/MeetingAssistant.Tests/RecordingCoordinatorTests.cs b/MeetingAssistant.Tests/RecordingCoordinatorTests.cs index cf26419..d26ca64 100644 --- a/MeetingAssistant.Tests/RecordingCoordinatorTests.cs +++ b/MeetingAssistant.Tests/RecordingCoordinatorTests.cs @@ -53,8 +53,14 @@ public sealed class RecordingCoordinatorTests { try { - return File.Exists(path) && - File.ReadAllText(path).Contains(text, StringComparison.Ordinal); + if (!File.Exists(path)) + { + return false; + } + + using var stream = File.Open(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite | FileShare.Delete); + using var reader = new StreamReader(stream); + return reader.ReadToEnd().Contains(text, StringComparison.Ordinal); } catch (IOException) { @@ -3290,6 +3296,7 @@ public sealed class RecordingCoordinatorTests await coordinator.StartAsync(CancellationToken.None); await audioSource.WaitUntilCapturedAsync(); + await artifactStore.WaitUntilTranscribingAsync(); await coordinator.StopAsync(CancellationToken.None); @@ -3433,6 +3440,7 @@ public sealed class RecordingCoordinatorTests { var audioSource = new CapturedChunkThenCancelAudioSource(new AudioChunk([1, 0, 2, 0], 16000, 1)); var artifactStore = new InMemoryMeetingArtifactStore(); + var metadataProvider = new BlockingMeetingMetadataProvider(new MeetingMetadata("Summary failure", [], "", null)); var coordinator = new MeetingRecordingCoordinator( audioSource, new TestSpeechRecognitionPipelineFactory(new FinalSegmentOnAudioCompletionProvider()), @@ -3443,11 +3451,15 @@ public sealed class RecordingCoordinatorTests new InMemoryRecordedAudioStore(), new CapturingMeetingSummaryPipeline(succeeded: false), Options.Create(CreateOptionsWithoutFinalizer()), - NullLogger.Instance); + NullLogger.Instance, + meetingMetadataProvider: metadataProvider); await coordinator.StartAsync(CancellationToken.None); + await metadataProvider.WaitUntilRequestedAsync(); await audioSource.WaitUntilCapturedAsync(); + metadataProvider.Release(); + await artifactStore.WaitUntilTranscribingAsync(); await coordinator.StopAsync(CancellationToken.None); Assert.Equal( @@ -3481,6 +3493,7 @@ public sealed class RecordingCoordinatorTests await coordinator.StartAsync(CancellationToken.None); await audioSource.WaitUntilCapturedAsync(); + await artifactStore.WaitUntilTranscribingAsync(); await coordinator.StopAsync(CancellationToken.None); @@ -4497,6 +4510,7 @@ public sealed class RecordingCoordinatorTests private sealed class InMemoryMeetingArtifactStore : IMeetingArtifactStore { + private readonly TaskCompletionSource transcribing = new(TaskCreationOptions.RunContinuationsAsynchronously); private readonly bool createAssistantContextFile; private bool failNextMetadataUpdate; @@ -4512,6 +4526,11 @@ public sealed class RecordingCoordinatorTests public List States { get; } = []; + public Task WaitUntilTranscribingAsync() + { + return transcribing.Task.WaitAsync(TimeSpan.FromSeconds(15)); + } + public string? Agenda { get; private set; } public DateTimeOffset? ScheduledEnd { get; private set; } @@ -4553,6 +4572,10 @@ public sealed class RecordingCoordinatorTests CancellationToken cancellationToken) { States.Add(state); + if (state == AssistantContextState.Transcribing) + { + transcribing.TrySetResult(); + } return Task.CompletedTask; } diff --git a/MeetingAssistant/MeetingAssistant.csproj b/MeetingAssistant/MeetingAssistant.csproj index 416b61e..6543f57 100644 --- a/MeetingAssistant/MeetingAssistant.csproj +++ b/MeetingAssistant/MeetingAssistant.csproj @@ -5,7 +5,7 @@ enable enable true - 1.51.2 + 1.52.0 @@ -20,7 +20,7 @@ - + diff --git a/openspec/changes/archive/2026-05-19-define-meeting-assistant-v1/specs/meeting-recording/spec.md b/openspec/changes/archive/2026-05-19-define-meeting-assistant-v1/specs/meeting-recording/spec.md index 2df0794..323f0bb 100644 --- a/openspec/changes/archive/2026-05-19-define-meeting-assistant-v1/specs/meeting-recording/spec.md +++ b/openspec/changes/archive/2026-05-19-define-meeting-assistant-v1/specs/meeting-recording/spec.md @@ -22,6 +22,12 @@ Meeting Assistant SHALL capture microphone input and computer output and combine - **WHEN** automated tests run without live audio devices - **THEN** Meeting Assistant verifies the audio mixer through deterministic source abstractions rather than depending on physical microphone or speaker devices +#### Scenario: Matching-stream verification controls source delivery +- **GIVEN** a microphone chunk has been accepted and matching system audio is pending within the supported skew window +- **WHEN** automated verification releases the matching system chunk +- **THEN** the mixer emits one combined chunk containing both sources +- **AND** source delivery is coordinated explicitly rather than assuming a timer continuation will run before the skew cutoff + ### Requirement: Stopping recording drains captured audio through transcription Meeting Assistant SHALL stop capturing new audio when recording mode is stopped, but it SHALL allow already captured audio to finish running through the configured speech recognition pipeline before the recording session completes. diff --git a/openspec/changes/archive/2026-05-19-define-meeting-assistant-v1/specs/meeting-summary/spec.md b/openspec/changes/archive/2026-05-19-define-meeting-assistant-v1/specs/meeting-summary/spec.md index 85c11a1..90a14d8 100644 --- a/openspec/changes/archive/2026-05-19-define-meeting-assistant-v1/specs/meeting-summary/spec.md +++ b/openspec/changes/archive/2026-05-19-define-meeting-assistant-v1/specs/meeting-summary/spec.md @@ -58,6 +58,12 @@ The summary agent SHALL be able to read and write the assistant context body as - **WHEN** transcription, final speaker recognition, and summary generation progress - **THEN** Meeting Assistant updates assistant context frontmatter state to `transcribing`, `speaker recognition`, `summarizing`, `finished`, or `error` as appropriate +#### Scenario: Summary failure follows initialized transcription +- **GIVEN** a meeting has completed its initial metadata collection and reached `transcribing` +- **WHEN** recording stops and automatic summary generation fails +- **THEN** assistant context transitions from `transcribing` to `summarizing` and then `error` +- **AND** observing captured audio alone does not establish that metadata collection has finished + #### Scenario: Summary pipeline is invoked - **WHEN** transcript processing finishes for the current meeting - **THEN** the agent can read the transcript, assistant context, user notes, glossary, and bound project knowledge, can write the finished markdown summary to the configured summary note, and can update existing project files diff --git a/openspec/changes/archive/2026-06-03-add-transcript-write-workflow-rules/specs/meeting-session/spec.md b/openspec/changes/archive/2026-06-03-add-transcript-write-workflow-rules/specs/meeting-session/spec.md index afd74bf..749302c 100644 --- a/openspec/changes/archive/2026-06-03-add-transcript-write-workflow-rules/specs/meeting-session/spec.md +++ b/openspec/changes/archive/2026-06-03-add-transcript-write-workflow-rules/specs/meeting-session/spec.md @@ -27,6 +27,12 @@ A `transcript_line` trigger MAY filter by speaker name. - **THEN** the written transcript line contains `[redacted]` - **AND** the written transcript line does not contain `*****` +#### Scenario: Live transcript verification does not obstruct durable writes +- **GIVEN** a live transcript line is being durably appended and then rewritten by a `transcript_line` rule +- **WHEN** automated behavior verification observes the live transcript file +- **THEN** its observer permits the ongoing append and rewrite rather than denying the writer access +- **AND** verification still requires the completed transcript line to contain the transformed text and no original masked profanity + ### Requirement: Meeting automation rules support conditions and steps Meeting Assistant SHALL support rule conditions using an expression engine.