Skip to content

Correct MicLiveness logSummary timeout wording to fail-closed - #329

Open
toufiqfarhan0 wants to merge 1 commit into
AssemblyAI:mainfrom
toufiqfarhan0:fix/mic-liveness-log-summary
Open

toufiqfarhan0 wants to merge 1 commit into
AssemblyAI:mainfrom
toufiqfarhan0:fix/mic-liveness-log-summary

Conversation

@toufiqfarhan0

Copy link
Copy Markdown

Fixes #328

Problem

In Sources/BlurtEngine/Audio/MicLiveness.swift, MicLiveness.logSummary returns "input liveness unconfirmed after \(cap) ms — proceeding, \(route)" when gap == nil.

However, as designed and documented in AGENTS.md ("failing closed on timeout: the recorder is torn down and start() throws .audioCaptureFailed"), MicCapture.start() does not proceed: it logs the summary at .error level and strictly fails closed (throw BlurtError.audioCaptureFailed(...)).

Having the log string say "— proceeding" while MicCapture.start() throws and aborts dictation creates confusion when diagnosing mic bring-up timeouts in system logs (log show --predicate 'subsystem == "dev.alex.blurt"').

Fix

  1. Updated MicLiveness.logSummary when gap == nil to say "— failing closed," instead of "— proceeding,".
  2. Updated Tests/BlurtEngineTests/MicLivenessTests.swift to assert the updated string.

Verification

  • scripts/check-invariants.sh passed.
  • scripts/check-portability.sh passed.
  • All 14 architectural invariants confirmed.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MicLiveness.logSummary reports proceeding on timeout, contradicting fail-closed behavior

1 participant