Repository navigation
fix(artifacts): order companion slots by byte compare - #12404
aniruddhaadak80 wants to merge 1 commit into
Conversation
pickBoundSlot and the split-view picker ordered machine ISO-8601 stamps with localeCompare, which is host-dependent and drops microsecond precision. Route both through a new compareIsoTsDesc seam helper matching the library page.
Opus 4.8 Review (fork) —
|
Design Review (Fable 5, fork) —
|
First Principles Review (Fable 5, fork) —
|
GPT 5.6 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. |
|
Closing as a duplicate of PR #10950 Thanks for finding this. Sorting Overlap
Why PR #10950 is the one to keep
I ran both comparators in node:
PR #10950 compares instants and adds back the sub-millisecond digits that Harvest: nothing to port. After PR #10950 lands, nothing would call If this is wrong, for example if you know an input that byte order orders correctly and instant order does not, reply here and we will reopen. From a full open-PR audit against origin/main c66f95b (2026-09-25); findings were checked by independent reviewers reading the code. Reply here if this is wrong. |
Problem / Motivation
pickBoundSlot in ArtifactDetailPage and the split-view picker in SessionGridView ordered machine ISO-8601 last_activity_ts values with localeCompare. The collator is host-locale sensitive and slower, and it disagrees with the library page's own byte-order compare, so two views could pick different companion sessions for one artifact slug, and sub-second-distinct stamps could misorder.
Why it matters
Wrong companion session opens on artifact race or History-resume cases. The i18n catalog explicitly blesses byte order for machine timestamps and flags bare localeCompare as a finding.
What changed (motivation, approach, change)
Added compareIsoTsDesc to the src/i18n/format.ts seam (newest-first byte compare, empty as oldest) and routed both pickers through it, mirroring the ArtifactsPage updated_at precedent. No visual change; ordering only.
Tests
Manual verification
N/A - unit coverage sufficient; no UI layout change (no screenshots).
Related Issues
None - self-identified defect during frontend i18n review.
Pattern harvest
Rule candidate: review-prompt
Pattern: localeCompare used on machine ISO timestamps instead of byte order
Checklist
Contribution License Agreement
N/A - placeholder wording pending OSPO; no CLA text invented.