Repository navigation
Live recorder transcription recovery: durable precompute, prompt Stop catch-up, resumed growing downloads (D-1202) - #268
Conversation
…cked - Renew PARTIAL_WAKE_LOCK periodically in RecorderSyncService and extend RecorderRunner round-trip hold to 30m (including full syncs with downloads) - Split RecorderLivePrecomputer inference step priority (normal/nice +2 instead of THREAD_PRIORITY_BACKGROUND cgroup throttling) - Persist .part precompute staging (checkpoints, append-only word log, PCM slice hashes, audio.opus.part move) via RecorderLivePrecomputeStore across reconnects and preemption - Retry blocked live precompute in RecorderLiveTailer, enable catch-up precompute in RecorderSync downloads, and use StreamingWavPrefixReader for .part WAV whistle replay
…rn full syncs before the round-trip hold (D-1202) - A closed LivePrecomputeHandle now keeps its AppGraph slot until the worker stops, so the next session over the same `.part.precompute/` directory joins it instead of loading or clearing files a cancelled save still writes. RecorderLiveTailer's PrecomputeHolder awaits the old worker before re-opening. - discardRecorderLivePrecompute deletes the staging directory once the active worker has stopped (RecorderLivePrecomputer.discard), not while a checkpoint save can recreate it. - RecorderRunner.attempt returns the outcome at once and keeps only the service run through the 30 min round-trip hold, so Auto sync keeps polling and a new recording is tailed live meanwhile. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Pipeline: review of cassini-android #268 says fix first. One round: fix every blocker and major, put the PR back to draft, push, mark ready on green. If you disagree with a finding, last line of PR body or comment: WAITING-ON-COORDINATOR: . VERDICT: fix first
|
…letion, not just the worker job (D-1202) A coroutine job counts as completed before its completion handlers run, so awaitStopped()'s cancelAndJoin() could return while discard()'s deletion handler was still removing the staging directory, letting a replacement worker open files that were being deleted. awaitStopped, finishAndInstall and invokeOnStopped now wait on a deferred that completes only after the worker finished and any requested discard deletion is done; a discard arriving after the worker stopped deletes under the same lock that the join waits on. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Pipeline: cassini-android #268 is merged (review: ship). Continue with your next item. |
Seat: local-claude
Participate: auto
Fixes D-1202
Summary
Brings in branch
feat/live-precompute-resilience(7cae2a00,66fb7bbd, unchanged) and adds one review-fix commit on top.Branch changes:
<part>.precompute/(checkpoint, append-only word log, Opus and clips) next to the.partfile. It verifies PCM slices only, never the 44-byte WAV header that Stop rewrites, so progress survives a Bluetooth disconnect, preemption, and reconnecting after Stop. The verification also accepts older checkpoints that kept a separatelive-source.json.4 × RECORDING_GETS_WINDOW), so Stop lifts the recording-speed limit even when a large backlog remains. After Stop, the remaining download wakes inference every 256 KiB..partwithliveHeaderPendingresumes after Stop. It checks the head (44..512) and the tail of the downloaded PCM against the recorder, refreshes the finalized header, and installs the staged checkpoint at import (installLivePrecompute). The planner accepts a live partial whose size grew.Review fixes (
04bed1b3):LivePrecomputeHandlefreed its AppGraph slot at once, thoughclose()only cancels its worker. The nextcreateRecorderLivePrecomputeon the same part (from the tailer'sensureActiveretry or a post-StopRecorderSync.download) skipped the join. It could then load or clear staging files while a cancelledsaveStagedwas still writing them. The slot is now freed only when the worker stops, andPrecomputeHolderawaits the old worker before it reopens.discardRecorderLivePrecomputedeleted the directory while a cancelled worker could still be writing into it.RecorderLivePrecomputer.discard()now deletes it once the worker has stopped.RecorderRunner.attempt(FULL)waited up to 30 min in the round-trip hold before returning its outcome. That stoppedRecorderAutoSyncfrom polling, so a recording started during the hold was not tailed live. The outcome now returns at once, and a detached coroutine keeps only the service run through the hold.Second review round (
091d64e9):4. Discard/reopen race: a coroutine job counts as completed before its completion handlers finish, so
awaitStopped()'scancelAndJoin()could return while the deletion handler fromdiscard()was still running. A replacement worker could then open staging files that were still being deleted.RecorderLivePrecomputernow completes astoppeddeferred only after the worker finishes and any requested discard deletion is done.awaitStopped,finishAndInstallandinvokeOnStoppedall wait on it. A discard that arrives after the worker has stopped deletes under the same lock that the join waits on.Review focus
RecorderLivePrecomputer(lifecyclelock,stoppeddeferred,joinStopped()): this replaces the earlier reliance on completion-handler order.verifiedLiveOffsetnow passes non-link transfer errors up instead of restarting from 0 (the branch does this on purpose: "a failed transfer leaves the prefix intact").Verification
detekt ciTest :app:lintDebug :data:lintDebug :ui:lintDebugpasses at091d64e9; earlier,:app:testDebugUnitTest --tests 'io.codemyriad.cassini.recorder.*'pass. New tests:discardDeletesStagingOnlyAfterTheWorkerStopsSaving,reopeningWaitsForAnInFlightDiscardDeletion(event-gated: it blocks the deletion and reopens undispatched; it fails against the previous handler-only discard) andfullAttemptReturnsAtOnceAndHoldsServiceUntilRoundTripTranscriptionEnds. Full CI on this PR.Checked bug classes
🤖 Generated with Claude Code