fix(transform): split uncertain flood gaps at midpoint - #146
Merged
ErikBjare merged 1 commit intoJul 23, 2026
Merged
Conversation
Greptile SummaryThis PR aligns Python flood-gap handling with the Rust midpoint behavior. The main changes are:
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (1): Last reviewed commit: "fix(transform): split uncertain flood ga..." | Re-trigger Greptile |
Contributor
Author
|
CI-green and mergeable (Greptile 5/5) — waiting only on a maintainer click. This PR is ready to merge, but the bot has pull-only access to this repo and can't self-merge — surfacing it here so it isn't lost. The monitoring loop will stop re-flagging it now that this note is posted. |
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.
Problem
Python and Rust assign short gaps between differing-data events differently:
That makes the same stored events produce different timelines depending on the server implementation. Neither side has evidence about the actual transition point; the gap exists precisely because collection did not observe it.
Decision: meet in the middle
Both rules are defensible:
I chose midpoint. Event duration is not a confidence measure; for heartbeat-derived events it often reflects batching or earlier transforms. Letting it decide an unobserved transition adds an unsupported bias and can move the boundary dramatically when one event happens to be long. Midpoint states the weaker, more honest assumption and already has an explicit Rust regression test.
Changes
flood()'s API documentation into the intended behavior/spec: ordering, pulsetime boundary, same-data merging, differing-data midpoint, and overlap precedence.The equal-data behavior remains unchanged: neighbouring equal-data events merge, preserving the longer event's extent.
Verification
poetry run pytest -q— 176 passed, 2 skippedpoetry run ruff check .— cleanpoetry run mypy aw_transform/flood.py— cleanFollow-up to #105; incorporates the implementation parity requested in #105 (comment).