Files
OSGKeyboard/OSGKeyboardShared/Utilities/FlowPipelineDiagnostics.swift
T
Cursor Agent 8b105430e3 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>
2026-07-06 05:13:58 +00:00

35 lines
1.0 KiB
Swift

// 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)"
)
}
}