Repository navigation
fix(pcap): order evidence ties by code point instead of host locale - #2509
Conversation
The pcap summary sorted equal-count endpoints and protocol stacks with String#localeCompare, and Flutter build inspection sorted APK ABI directory names the same way. localeCompare follows the host's ICU locale, so the same capture produced differently ordered Evidence on different hosts: under da_DK "aarp" sorts after "zz", under lt_LT "syslog" sorts before "ssdp", and every locale puts "fe80::1" before "fe80:1::1". Use the repository's compareUnicodeCodePoints, as the other Evidence producers already do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
|
@greptileai review |
|
Problem
inspect_pcap_capturebreaks ties between equal-count endpoints and protocol stacks withString#localeCompare. Flutter build inspection sorts APKlib/<abi>/directory names the same way.localeComparefollows the host's ICU default locale, which comes fromLANG. The same capture can therefore produce differently ordered Evidence, with a different digest, depending on which host or shell ran REA:Every locale also disagrees with code-point order on IPv6 text: it sorts
fe80::1beforefe80:1::1. The other Evidence producers already use the locale-independentcompareUnicodeCodePoints(src/domain/unicodeCodePointOrder.ts). These four calls were the only production uses oflocaleCompare.Fix
The two pcap sorts and the two Flutter ABI sorts now use
compareUnicodeCodePoints. Primary orderings are unchanged: packet count, and Flutter's ABI preference list. The usual Flutter ABIs (arm64-v8a,armeabi-v7a,x86,x86_64) sort the same either way.Validation
PcapOutput.test.tscase: equal-countfe80::1andfe80:1::1endpoints, pluseth:llc:zzandeth:llc:aarpprotocols. It fails on main under any locale and passes with this change.npm run test:focusedpassed for the pcap provider, retained-view, CLI and MCP tests and the Flutter boundary tests, except one pre-existing failure.pcapProviderCrossPlatform.test.ts > rejects a path that is not a readable file. It fails the same way on clean main on macOS, because hosts without a native bound refuse before reading the path. It's unrelated to this change, and I'm fixing it in a separate PR.npm run check:fastandformat:checkpass.🤖 Generated with Claude Code
Summary by CodeRabbit