[Drift Audit] Correct interval API and Duration type in the wide-events rule doc - #9355
Draft
daxmobile wants to merge 1 commit into
Draft
[Drift Audit] Correct interval API and Duration type in the wide-events rule doc#9355daxmobile wants to merge 1 commit into
daxmobile wants to merge 1 commit into
Conversation
The rule doc still described intervalStart as a two-argument call with manually bucketed key names, and used java.time.Duration in the CleanupPolicy example. The API has taken timeout/buckets parameters and used kotlin.time.Duration since #8381. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
4 tasks
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.
Task/Issue URL: (app.asana.com/redacted)
Description
.cursor/rules/wide-events.mdc— the interval section and theCleanupPolicy.OnTimeoutexample.The wide-events area changed in this window via
#7965— Add support for wide event sampling (2ac7b09149). That PR updated the doc for sampling itself, and I verified the new Sampling section againstWideEventClientImpl—SAMPLED_OUT_FLOW_ID = -1L, theif (wideEventId == SAMPLED_OUT_FLOW_ID) return Result.success(...)short-circuit in every method, and the persisted probability — it is accurate and I left it alone. Re-reading the rest of the doc against the API surfaced two claims that no longer hold.1.
intervalStart— described as a two-argument call with hand-bucketed keys.What the doc described:
intervalStart(wideEventId, key)under the comment "always use bucketed values, not raw ms", which reads as an instruction to bucket at the call site via the_ms_bucketednaming convention.The code change that invalidated it:
#8381— Configurable interval buckets on WideEventClient.intervalStart (a8076fbe81).intervalStartnow takestimeout: Duration? = nullandbuckets: Set<Duration>? = DEFAULT_INTERVAL_BUCKETS, and the client does the bucketing — rounding down to the nearest boundary, recording0below the smallest, and recording the raw duration whenbucketsis null. Real callers pass custom bucket sets (PageLoadWideEvent,PirScanWideEvent) and timeouts (SubscriptionSwitchWideEventat10.minutes,SubscriptionPurchaseWideEventat4.hours) — none of which the doc mentioned.The
timeoutgap also left a dangling concept: the CleanupPolicy section documentsignoreIfIntervalTimeoutPresentas "keep alive if an interval timeout is set", but nothing in the doc explained what sets one.How it now reads: the API example shows
intervalStartwithtimeoutandbuckets, and a new Intervals subsection states the rounding-down behaviour, the default bucket set, whatnulldoes, and ties thetimeoutparameter back toignoreIfIntervalTimeoutPresent.2.
CleanupPolicy.OnTimeout(duration = Duration.ofDays(7))no longer compiles.The same PR migrated the API from
java.time.Durationtokotlin.time.Duration—flowStart's default is nowOnTimeout(duration = 7.days)andintervalEndreturnsResult<kotlin.time.Duration>. The doc'sDuration.ofDays(7)is ajava.timecall against akotlin.timeparameter. Now reads7.days, with a line naming the type so the10.minutes/7.daysliterals aren't guesswork.I also checked, and did not treat as drift:
.cursor/rules/pixels.mdc/pixel-definitions.mdcvs#9306(unified_input_surfaceadded to unified-input action pixels, plus aparams_dictionaryentry) and the PIR pixel additions inPirPixel/PirPixelSender/PirPixelInterceptor— routine additions that follow the documented shape; no documented claim became false..cursor/rules/android-design-system.mdc—Theming.ktandMessageCta.ktsaw small edits, but nothing the doc describes. Note this doc already has two open Drift Audit PRs against it (#9300,#9315); I stayed out of it to avoid conflicting edits..cursor/rules/maestro-ui-tests.mdc— three.maestro/**files changed by one line each (onboarding test content), not the tags/config/run mechanics the doc describes..cursor/rules/architecture.mdc— the remaining merged PRs in the window (simplified sync UI, native input, onboarding dialogs, content-scope-scripts bumps, PIR renderer-crash handling, Glide cache fix, Develocity plugin bump) are all inside-implcode or build config the rule docs don't describe.One thing for a human to weigh: the interval drift dates from
#8381(30 Apr), not from this window's#7965. I fixed it because re-checking the wide-events doc is exactly what a change in that area calls for and the mismatch is unambiguous — the example doesn't compile — but if the preference is to keep each Drift Audit PR strictly to its window, that is a fair reason to trim this one..cursor/rules/wide-events.mdcis the only file changed — no code, and the.claude/rulessymlink is untouched.🤖 AI-docs Drift Auditor
Steps to test this PR
WideEventClient.intervalStart's KDoc andDEFAULT_INTERVAL_BUCKETSinstatistics/statistics-api/.../wideevents/WideEventClient.kt, and confirm the rounding-down / zero-below-smallest / null-disables-bucketing description matches.Durationtype claim:WideEventClient.ktimportskotlin.time.Durationand defaultsflowStart's cleanup policy toOnTimeout(duration = 7.days), so the corrected7.daysexample compiles andDuration.ofDays(7)would not.PageLoadWideEvent/PirScanWideEventpass custombuckets,SubscriptionSwitchWideEventpassestimeout = 10.minutes— and confirm the doc'stimeout/bucketsguidance reflects real usage.UI changes
Note
🔒 Integrity filter blocked 4 items
The following items were blocked because they don't meet the GitHub integrity level.
search_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".search_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".search_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".list_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".To allow these resources, lower
min-integrityin your GitHub frontmatter: