Repository navigation
Reliability: remembered handshake bound, merged gap markers, ordered writes - #25
Merged
Merged
Conversation
added 15 commits
November 23, 2026 03:25
…st succeeded Probe 7: outages of 22.5 / 25.5 / 55.5 s for accepts of 12 / 15 / 25 s, because the bound restarted at 10 s after each successful reconnection. The round-8 spec "a new outage starts again at 10 s" is changed: with the same slow server (15 s) the next outage needs one attempt and lasts about the accept delay. New guard: after a fast accept the bound is back to 10 s.
…d gaps merge into one
… writes complete in
…t worked Why: the bound restarted at 10 s after each successful reconnection, so a slow server cost one failed attempt per outage (probe 7: outages of 22.5 / 25.5 / 55.5 s for accepts of 12 / 15 / 25 s). What: per source, a successful reconnection records its bound when the accept took longer than 10 s, and 10 s when it was faster; a new outage starts from it. Still one attempt at a time, doubled after an expiry, 60 s at most. The accept speed is measured with a timer so it follows fake time in tests. How proven: slow_accept specs green (same slow server: one attempt, outage about the accept delay; after a fast accept back to 10 s), connect timeout and client specs green.
Why: three losses declared at the same instant left three nested markers in the note (probe 7), and the re-stamp of a sealed sentence was not chained after its first save: with a slow write the sentence ended at its arrival time instead of the gap start. What: - _writeGapMarker is the only writer of gap markers: a loss touching or overlapping markers of the same source merges them into one, the union, under the first marker's id; the others are removed from the database and the screen. Sources never merge. - Writes are chained per segment id (_chainWrite), so the last intended value of a segment always lands last; _savePartial, the re-stamp and marker merges go through it. How proven: gap_marker_merge and restamp_write_order specs green (both completion orders); sealed_partial_time and late_done_after_gap green; services suite green (899).
…pping markers (probe 7)
…rovisional never merges with a later loss
…ings go only after the union
Why: the provisional marker is written outside the live merge, and a kill during an outage can leave overlapping markers on disk (probe 7); plan() trusted what was stored and planned nested intervals twice. What: plan() merges the gap markers of one source that overlap or touch into unions: one interval under the first marker, the end of the latest; the absorbed markers go into replacedIds and are removed when the union is recovered. The extension of an interval to the next intact segment stops where the next union of the source starts, so no audio is transcribed twice. The end-edge exception uses the union's end. How proven: gap_backfill_overlapping_markers (probe-7 stored state) green; time edges, edge exception, backfill, overlap, sealed partial and marker merge specs green (39).
Why: the union of overlapping losses and the removal of the absorbed markers ran on different chains, and a failed earlier write for an id skipped every later write for it: an interval could be left with no marker. What: the union write waits for pending writes of the absorbed markers, saves the union (retried 1, 2, 4, 8 s; saveSegment now says whether it stored), and only then removes the siblings. _chainWrite logs a failed write and still runs the next one for that id. How proven: gap_marker_merge_atomic (failing and held repository) green with gap_marker_merge, restamp_write_order and sealed_partial_time (11); core_domain 58 green.
Why: the app lives in the menu bar for days; a slow server learned in one session made every later session wait up to 60 s for a dead socket. What: connect() resets the learned slow-accept count of both sources. How proven: transcription_remote_data_source_slow_accept green (7).
Why: five attempts then a logged give-up is a deliberate shortcut; Stop may wait up to 15 s more on a failing disk. What: ponytail comment only. How proven: analyze clean.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
saveSegmentreports whether the segment was stored.Checked
Not checked