Skip to content

fix(transform): skip contained zero markers without losing flood bridges - #202

Open
TimeToBuildBob wants to merge 2 commits into
ActivityWatch:masterfrom
TimeToBuildBob:fix/flood-skip-zero-duration-before-pairwise
Open

TimeToBuildBob wants to merge 2 commits into
ActivityWatch:masterfrom
TimeToBuildBob:fix/flood-skip-zero-duration-before-pairwise

Conversation

@TimeToBuildBob

@TimeToBuildBob TimeToBuildBob commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fix a contained zero-duration marker blocking a short-gap comparison without removing standalone zero-duration bridges.

Fixes #201.

Verification

  • Erik's counterexample A(0,1), X(5,0), B(10,1) failed on the prior PR (2s); now retains the exact existing 11s bridge.
  • Original reporter fixture still totals 10s with and without the contained marker, and is idempotent.
  • Standalone, endpoint, nested-positive and later-wins/prefix-maximum controls remain unchanged.
  • Flood tests: 20 passed. Full Python suite: 435 passed, 5 skipped. An initial full run hit the existing random test-bucket ID collision; a fresh full rerun passed.
  • Ruff format/check, diff check and enabled commit hooks pass. Rebased onto fetched upstream master.

Design boundary

A running maximum end is deliberately not used to change positive-event midpoint/threshold semantics. For A[0,10], X[5,7], B[12,13], the established split is 9.5, not 11. Likewise A[0,10], X[5,6], Z[8,8], B[12,13] needs Z retained because the later-wins X has already superseded A. Prefix-max marker filtering would remove a valid bridge. This repair is scoped to the reported contained-zero defect, not a flood rewrite.

Synthetic transform coverage; not a released-server/query-engine acceptance claim. Merge and containing release remain outstanding.

@greptile-apps

greptile-apps Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no blocking issue was found.

Summary

flood now skips zero-duration markers inside the preceding retained event before comparing neighbouring events.

  • Contained zero markers no longer interrupt nearby gap filling.

Reviews (2) · Last reviewed commit: "fix(transform): preserve standalone zero..." · Reviewed by Greptile

@TimeToBuildBob

TimeToBuildBob commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor Author

Superseded after Erik’s batch review: the previous blanket zero-duration filter lost standalone bridges. Repaired in 3e7f59a; the PR body now records the paired fix and regression controls. Awaiting current-head CI/review, not ready solely on the old green checks.

@TimeToBuildBob

TimeToBuildBob commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 AI code review

Adds a preprocessing pass to flood() that removes zero-duration events whose timestamps fall within the preceding retained event's half-open span. Adds four regression tests covering contained markers, standalone bridges, markers following nested positive events, and endpoint markers.

Safe to merge — no P0/P1 findings

Confidence 5/5

✅ No findings. The diff looks correct to me on this pass.

Files changed (2) — the diff as I read it
  • aw_transform/flood.py — Adds visible_events filtering before pairwise flooding and documents the treatment of contained, standalone, and endpoint zero-duration markers.
  • tests/test_flood.py — Adds four tests asserting flooding results for contained markers, standalone bridges, markers after later-wins events, and endpoint markers.
Previous review passes
commit score findings engine when
bbfb5456f075 5/5 0 subscription 2026-11-07 00:43 UTC

Reviewed 3e7f59a55b91 · panel: codex:gpt-6.1-sol + claude-code:sonnet · subscription engine · 58s · about this reviewer

Maintainer commands

@TimeToBuildBob review (own line) — fresh review · @TimeToBuildBob fix — a worker acts on the findings. Once per comment; 👀 = received.

A duration-0 event is dropped from flood() output but still occupied a
zip() slot, so a pulsetime-sized gap between its neighbours was never
filled (ActivityWatch#201). Filter duration<=0 after sort and
before pairing; keep dropping zeros from the result.

Git-Session-Id: 7fc44e80-fb4f-4bfb-91a6-b7073b59f193
Git-Session-Id: e4eca198-7b3f-513e-824a-410b51d9a94d
@TimeToBuildBob
TimeToBuildBob force-pushed the fix/flood-skip-zero-duration-before-pairwise branch from bbfb545 to 3e7f59a Compare November 7, 2026 17:16
@TimeToBuildBob TimeToBuildBob changed the title fix(transform): skip zero-duration events before flood() pairwise fix(transform): skip contained zero markers without losing flood bridges Nov 7, 2026
@TimeToBuildBob

TimeToBuildBob commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor Author

Correction (2026-11-07 audit): the earlier ready claim used Greptile 5/5 on pre-rework bbfb545 and was invalid. Refreshed through greptile-helper on the actual head.

Verified 2026-11-07 19:39 UTC: current head 3e7f59a; Greptile now explicitly reviews that exact commit at 5/5 (updated 19:36:48Z), current-head checks SUCCESS, MERGEABLE, zero review threads. Maintainer merge remains separate; this is not a released-server acceptance claim. Any new push invalidates this readiness evidence.

@TimeToBuildBob

Copy link
Copy Markdown
Contributor Author

@greptileai review

@TimeToBuildBob

Copy link
Copy Markdown
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.

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.

flood(): a zero-duration event silently blocks gap flooding between its neighbours

1 participant