Skip to content

Interval/29 gap incident coalescing - #31

Merged
quangshuynh merged 4 commits into
mainfrom
interval/29-gap-incident-coalescing
Sep 21, 2026
Merged

quangshuynh merged 4 commits into
mainfrom
interval/29-gap-incident-coalescing

Conversation

@quangshuynh

Copy link
Copy Markdown
Owner

What changed

Why

Validation

  • xcodebuild -project ScribeKit.xcodeproj -scheme ScribeKit -destination 'platform=macOS' build
  • xcodebuild -project ScribeKit.xcodeproj -scheme ScribeKit -destination 'platform=macOS' test

Transcript and privacy impact

Energy and performance impact

Recognition falling behind capture does not lose audio once. It keeps
losing it for as long as it stays behind, and the pipeline reported each
accumulated half second as its own gap, so a meeting that spent minutes
behind buried its transcript under hundreds of near-identical
blockquotes.

Observations are now accumulated into a TranscriptGapIncident and
written as one marker when the incident ends. The marker states two
quantities and keeps them apart: the range the incident spanned, and the
audio it actually cost. The total is a sum over distinct evicted buffers
— the bounded backlog hands each one back exactly once — and is never
derived from the range, because recognition goes on transcribing between
the losses.

What separates one incident from the next is evidence rather than a
delay. TranscriptionAudioInput reports closesIncident once the backlog
has accepted a full capacity of audio without evicting any of it, which
it could not do while still full; MeetingRuntime closes an incident at
every boundary the pipeline cannot see — pause, recogniser restart,
capture ending, stop, persistence failure — so no failure is hidden
inside another.
A marker's range is not known until the incident ends, so an incident
held only in memory would go with the process that was killed during it.

The session record now carries openGapStartedAt: set the moment an
incident opens, and cleared after the marker has reached the transcript
— that order, because the failure window then repeats a notice rather
than losing one. Recovery states the start and refuses the rest: the end
and the total were still being measured, and either would be invented.

The field is additive and optional, like pausedAt, so the record's
schema version is unchanged and earlier sessions read exactly as before.
Noting one never fails a meeting whose transcript is intact.
Adds the regression the interval exists for: 430 half-second
observations over three and a half minutes, through the real Markdown
writer to a real file, leaving one blockquote stating the range and the
audio lost.

Also covers an isolated short gap, separate incidents with speech
between them, pause and recogniser-restart boundaries, a stop with an
incident still open, a marker that cannot be written at stop, the
backlog-recovery evidence in TranscriptionAudioInput, the range and
point wordings across a minute boundary and noon, and the open-incident
record and its recovery note.
Explains that related recognition-backpressure losses are summarised
into one incident with one marker, that the range and the audio lost are
separate quantities, and that an incident still open when ScribeKit
stops is recorded and reported by recovery without inventing its end or
its cost.
@quangshuynh
quangshuynh merged commit da6dd12 into main Sep 21, 2026
3 checks passed
@quangshuynh
quangshuynh deleted the interval/29-gap-incident-coalescing branch September 21, 2026 16:35
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