fix(flow): drain trailing audio and harden chunked ASR pipeline
- P0/P1: tail-drain state machine in FlowContinuousCapture with converter flush; FlowSessionManager awaits drain before finalize - P2: FlowCaptureTailDrain policy/tracker, pipeline diagnostics, unit tests - P3: short final chunk merged re-transcription in ChunkedUtterancePipeline - P4: UtteranceTranscriptStitcher composedSafely fallback; preview path parity in LiveDictationController Co-authored-by: Rocky <hkgood@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
// FlowPipelineDiagnostics.swift
|
||||
// OSGKeyboard · Shared
|
||||
//
|
||||
// Structured Flow pipeline metrics for Console.app filtering.
|
||||
|
||||
import Foundation
|
||||
import os
|
||||
|
||||
public enum FlowPipelineDiagnostics {
|
||||
public static func logDrain(_ report: FlowCaptureDrainReport) {
|
||||
OSGLog.flow.info(
|
||||
"tailDrain duration=\(report.drainDurationSeconds, format: .fixed(precision: 2))s " +
|
||||
"silenceEnd=\(report.endedBySilence) tailSamples=\(report.tailSampleCount)"
|
||||
)
|
||||
}
|
||||
|
||||
public static func logChunkFinalize(
|
||||
chunkCount: Int,
|
||||
lastChunkSamples: Int,
|
||||
stitchedLength: Int,
|
||||
chunkWarnings: Int
|
||||
) {
|
||||
OSGLog.flow.info(
|
||||
"chunkPipeline chunks=\(chunkCount) lastChunkSamples=\(lastChunkSamples) " +
|
||||
"stitchedLen=\(stitchedLength) warnings=\(chunkWarnings)"
|
||||
)
|
||||
}
|
||||
|
||||
public static func logStitcherSafeFallback(naiveLength: Int, mergedLength: Int) {
|
||||
OSGLog.asr.warning(
|
||||
"stitcher safe fallback naive=\(naiveLength) merged=\(mergedLength)"
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user