feat: record(occurred_at=) for importing history - #13
Merged
Conversation
Pairs with khwan-engine #31. Without it an import stamps every packet with the minute it ran: replaying two months of transcripts produced packets spanning twelve minutes, so retrieval cannot tell a decision from June from one made this morning, and a recency tiebreak has nothing to work with on exactly the data most likely to hold a superseded fact. Both clients. Absent, the field is not sent at all, so an ordinary turn carries no extra bytes and an older engine sees the body it always did. Tests cover the blocking path, the background path — where the body is built once and handed to a thread, so the timestamp has to be in that copy — and the absence case. The background one waits for the thread directly rather than through flush(), which lives in another branch, so this stands alone. 0.4.0: the record signature grows a keyword, and this is the release someone would pin to get it.
Merged
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.
Client half of khwan-engine#31.
Without it an import stamps every packet with the minute it ran. Measured on a real brain: replaying transcripts spanning 22 June → 24 August produced packets spanning twelve minutes. Retrieval then cannot tell a decision from June from one made this morning, and a recency tiebreak has nothing to work with on exactly the data most likely to hold a superseded fact.
Both clients, sync and async. Absent, the field is not sent at all — an ordinary turn carries no extra bytes and an older engine sees the body it always did.
Tests
The background case matters on its own: that path builds the body once and hands it to a thread, so the timestamp has to be inside that copy rather than added afterwards.
It waits for the thread directly instead of calling
flush(), which lives in #12 — so this branch stands alone and the two can merge in either order.All existing suites pass.
0.4.0
record()grows a keyword; this is the release someone would pin to get it.