Skip to content

Resume work a quit or crash cut short, and checkpoint long steps. - #94

Merged
dillonstreator merged 2 commits into
mainfrom
claude/pipeline-resumability-51049a
Nov 27, 2026
Merged

dillonstreator merged 2 commits into
mainfrom
claude/pipeline-resumability-51049a

Conversation

@dillonstreator

Copy link
Copy Markdown
Member

Summary

Until now, a quit or crash in the middle of a session's work lost it. Words transcribed during a recording were only saved when the recording stopped. Settling speakers and writing the summary were started by in-memory events, so they never ran again after a restart. Now Lyra picks the work up the next time it starts (src/main/resume.ts).

  • Transcription. While recording, raw/live.json is saved every few seconds with an open-ended untranscribed mark per track. A mark is also saved the moment a take starts, so a crash before the first words still leaves one. At the next start, the marked audio is transcribed again from audio/*.wav, and only the words after each mark are kept. Whisper's prompt is the words heard just before the gap.
  • Owed steps. The manifest has a new pending list of transcribe, speakers and notes. Each is added when it becomes due and removed when it ends. A step that fails is removed too, so it isn't retried and re-reported at every launch. A step cut off by the quit itself stays owed (lifecycle.ts). Startup only reads sessions that owe something, and it never moves an unreadable live.json aside.
  • Recovered words get speakers. Any session with recovered words is relabeled, which rebuilds its lines from every word and then owes the summary.
  • Checkpoints (checkpoint/ in the session folder, kept apart from raw/, where every file is a pass):
    • Diarization: the whole recording's result is kept, keyed by the audio's length, the words and the settings, so a retry doesn't diarize it again.
    • Notes answers: each model answer is kept, keyed by prompt and writer, so a long meeting's retry only asks for the sections it doesn't have. This covers the AI SDK, Ollama and local-worker writers.
    • Each checkpoint is deleted once its step is done.
  • Downloads already resumed from their .part file. They now pick up as soon as a resumed step needs the model.
  • Activity: resumed transcription shows there under a new transcribe kind.
  • Testing: pnpm smoke:meeting --crash replays a recording that dies halfway, then resumes it the way the next start would.

Design notes are in docs/SESSION-MODEL.md → "Resuming interrupted work".

For reviewers:

  • Manifests written before this change read as owing nothing. Only crashes from now on are resumed.
  • DiarizeResult and its parts in meeting/protocol.ts are now zod schemas, so the diarization checkpoint is validated when it's read back.
  • relabelSession now resolves to how it ended (labeled, unlabeled or skipped), so resume knows whether the lines were rebuilt.

Checks

  • pnpm typecheck (and pnpm check: lint, unit tests, CONFIG.md)
  • Changeset added (.changeset/resume-interrupted-work.md)
  • pnpm smoke:ui: new checkResume case, plus a check that a later take's marks start at that take
  • Stays local-first: checkpoints are local files in the session folder, and nothing new leaves the device

QA with real audio (test-audio/meeting.wav, the 8-line two-voice script):

  • Normal replay: 8 lines, 2 speakers, alternating correctly.
  • --crash at 50%: resume re-transcribed 24 s (53 words) and relabeled it. 5 lines, 2 speakers, correct up to the crash point.
  • Crash at 85%: only the 16.7 s after the last checkpoint was re-transcribed. 48 live words + 39 recovered, no duplicates, 7 lines.
  • Speaker eval gate (LYRA_SESSIONS_CORPUS=mini pnpm eval:sessions --quick --check): there's no win32-x64 baseline, so --check can't pass on Windows. The totals match the stored macOS baseline: WER 20.5 vs 20.3%, cpWER 23.7 vs 23.5%, DER 15.8 vs 15.8%. room-2-music is 66% on both.

Not covered:

  • A real process kill (the crash is simulated in-process).
  • A crash early in a second take beyond the smoke check.
  • Picking up a summary from its saved answers after a real interruption.
  • Seeing the new Activity row in pnpm dev.

- Save raw/live.json every few seconds while recording, with open-ended
  untranscribed marks; the next start transcribes the marked audio again.
- Track owed steps (transcribe, speakers, notes) in the manifest's pending
  list; resume.ts picks them up at startup, reading only sessions that owe
  something.
- Keep the whole recording's diarization and each notes model answer as
  checkpoints, so a retry skips what was already done.
- Add `--crash` to smoke:meeting to replay a crash and the resume.
@vercel

vercel Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
lyra Ignored Ignored Preview Nov 27, 2026 6:57pm UTC

…ability-51049a

# Conflicts:
#	apps/lyra/src/main/meeting/relabel.ts
@dillonstreator
dillonstreator merged commit e8b8d64 into main Nov 27, 2026
13 checks passed
@dillonstreator
dillonstreator deleted the claude/pipeline-resumability-51049a branch November 27, 2026 19:03
@adavila0703 adavila0703 mentioned this pull request Nov 27, 2026
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.

1 participant