Repository navigation
feat: record capture records as they arrive - #43
Merged
Merged
Conversation
tomrford
force-pushed
the
feat/capture-recorder
branch
from
August 19, 2026 18:44
a85ff31 to
d2209e6
Compare
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.
Summary
Contract
The task owns delivery only. The caller owns writer flushing, closing, rotation, and capture retention. Its cursor marks records accepted by the writer, not durable storage, so pruning requires a successful writer flush or commit.
To record through shutdown, stop capture producers, stop the recorder, then flush or close the writer.
Verification
Note
Medium Risk
New concurrent delivery path around capture retention and writer errors; mis-timed pruning or flush relative to Cursor could drop or duplicate records in production wiring.
Overview
Adds a new
recorderpackage with aTaskthat continuously handsCapturerecords to agocan.RecordWriterby polling on an interval and advancing viaWriteRecordsSince, without blocking appends.Startwrites the initial retained window synchronously (from a caller-chosen cursor), then runs a background loop until stop, writer error, orErrCursorOutOfRangeafter capture discard (e.g.Clear).Stopis idempotent and performs one final pass so late appends are not lost.Cursor,Done, andErrmirror thecyclictask style; the cursor reflects writer acceptance, not durable storage.Tests cover in-order recording, partial progress on initial writer failure, shutdown final window, and termination when the capture can no longer place the cursor.
Reviewed by Cursor Bugbot for commit fbf306a. Configure here.