refactor(timeline): parse each usage timestamp once before sorting - #582
refactor(timeline): parse each usage timestamp once before sorting#582seonghobae wants to merge 8 commits into
Conversation
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Current exact authority
developmental@2fa92012bcf80acc1f921a4bafea76b3b1424b46e1dd7cc5c6ce9cc33990b4f0fc5b4e80dfae7e5esession-timeline-chart.tsxplus its focused test onlyFinding and causal repair
The generated branch correctly recognized repeated
Date.parse()inside the sort comparator, but its implementation discarded the pre-parsed key immediately after sorting and parsed every usage timestamp again during the merge pass. It therefore reduced comparator-time parsing but did not realize the intended one-parse-per-usage boundary.The current descendant keeps
{ usage, parsedTimestamp }through sorting and reuses that primitive as the merge cursor timestamp. A focused regression spies onDate.parsewith three unsorted usage rows and no tool events, requires exactly one parse per usage row, and verifies chronological output. Existing cumulative tool-summary and input-order immutability tests remain.Evidence discipline
The branch-generated
.jules/bolt.mdrule and source comment generalized this into anO(N)sorting optimization and claimed hot-loop performance without a committed representative benchmark. That is not correct: sorting remainsO(N log N); only timestamp parsing for usage sort keys is bounded to oneO(N)pass. The repository-wide Bolt doctrine was restored byte-for-byte to protected authority and the unmeasured source performance claim was removed.This PR therefore claims only the deterministic operation-count improvement and behavior preservation. Buyer-path latency, allocation/GC reduction, or material render-speed improvement require separate representative benchmark/profile evidence before being asserted.
Exact-head gates
Fresh workflows for
e1dd7cc5...are non-terminal: CI33997964975, Security Scan33997965035, SAST Semgrep33997964993, CodeQL PR33997964996. Predecessor checks are not transferred. Keep Draft until the unchanged head has terminal applicable gates, zero valid unresolved findings, fresh protected-base compatibility, and the then-live independent-review requirement.