Flagged by the PR-6 (#139) Opus code-council (architecture lens).
The "no-live-pipeline restart naming" block — stripSegmentSuffix → CrashRecoveryPlanner.safeRestartChunkIndex → baseName = "\(sessionId)-\(idx)" → incrementedSegment(...) → stamp newSentinel.chunkIndex = idx — now appears in three places:
TranscriberCore/RecordingCoordinator.handleXPCCrash (moved there by PR-6)
TranscriberApp/TranscriberApp.swift recoverIfNeeded (~L316-335)
TranscriberApp/TranscriberApp.swift setupCrashHandler (~L382+)
This is precisely the logic #135 (chunk-index vs segment namespace collision) and #154 finding 6 (chunkIndex floor) already bit on. Three copies means a future fix must land in all three or silently drop audio.
Fix: hoist it into a pure CrashRecoveryPlanner.planRestart(sentinel:outputDirectory:) -> (baseName: String, newSentinel: RecordingSentinel) (CrashRecoveryPlanner already owns safeRestartChunkIndex, so it's the natural home) and call it from all three sites. Pre-existing duplication — PR-6 deliberately left the two launch-time app sites untouched to keep its blast radius small; this is the consolidation follow-up. Related: #139.
Flagged by the PR-6 (#139) Opus code-council (architecture lens).
The "no-live-pipeline restart naming" block —
stripSegmentSuffix→CrashRecoveryPlanner.safeRestartChunkIndex→baseName = "\(sessionId)-\(idx)"→incrementedSegment(...)→ stampnewSentinel.chunkIndex = idx— now appears in three places:TranscriberCore/RecordingCoordinator.handleXPCCrash(moved there by PR-6)TranscriberApp/TranscriberApp.swiftrecoverIfNeeded(~L316-335)TranscriberApp/TranscriberApp.swiftsetupCrashHandler(~L382+)This is precisely the logic #135 (chunk-index vs segment namespace collision) and #154 finding 6 (chunkIndex floor) already bit on. Three copies means a future fix must land in all three or silently drop audio.
Fix: hoist it into a pure
CrashRecoveryPlanner.planRestart(sentinel:outputDirectory:) -> (baseName: String, newSentinel: RecordingSentinel)(CrashRecoveryPlanner already ownssafeRestartChunkIndex, so it's the natural home) and call it from all three sites. Pre-existing duplication — PR-6 deliberately left the two launch-time app sites untouched to keep its blast radius small; this is the consolidation follow-up. Related: #139.