Repository navigation
fix(apple): order projection paths by Unicode code point - #3294
Conversation
The Apple projection sorted application roots, bundle paths and symlinks with relational string operators, which compare UTF-16 code units, so a name with U+10000 sorted before one with U+FFFD. Use the shared compareUnicodeCodePoints instead and remove compareProjectionStrings, whose documented code point contract it did not meet. Fixes #3177
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
|
Thank you for reusing Unicode code-point ordering in the app projections, @Sriram-PR. Unicode paths now sort consistently between the inventory and those projections. Welcome to the project! |
Summary
project-apple-application-graphsortedapplication_roots,bundles[].pathandsymlinkswith JS</>, which compare UTF-16 code units rather than code points. A name containing U+10000 (surrogate pair starting at 0xD800) therefore sorted before one containing U+FFFD, the reverse of the code point order the inventory already uses and thatcompareProjectionStringsdocuments.Fixes #3177
Problem and expected behavior
Smallest trigger: two app roots
A\u{10000}.appandA\ufffd.app. Code point order puts U+FFFD (65533) before U+10000 (65536); the projection returned them the other way round. BMP-only names were unaffected, since code unit and code point order agree there.Change and scope
compareProjectionStrings(inmobileApplicationGraphProjection.ts) is removed. Its callers in the Apple, Android and Harmony projections now use the existingcompareUnicodeCodePointsfromunicodeCodePointOrder.ts, so there is a single owner for this ordering.compareinappleBundleAnatomy.ts, used for roots, bundles and platforms, had the same code unit comparison and now usescompareUnicodeCodePointstoo.Contribution scope: ordinary fix within existing boundaries; no scope decision needed.
Contract and boundary impact
src/domain/unicodeCodePointOrder.ts(unchanged) becomes the only comparator for these projection arrays; change is in the domain projection stage.projection_idchanges for affected inputs because the ordered payload changes; it stays deterministic.Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.
Evidence and regression coverage
src/domain/apple/appleApplication.test.ts, a parameterized test with the astral/BMP pair from the issue and a BMP-only control. It checksapplication_roots,bundles[].pathandsymlinks.expected [ 'A\ud800\udc00.app', 'A\ufffd.app' ] to deeply equal [ 'A\ufffd.app', 'A\ud800\udc00.app' ]; the BMP control passes.inspect-artifactandproject-apple-application-graphnow returns:For evidence-bearing changes:
Validation performed
npm run test:local -- src/domain/apple/appleApplication.test.ts— 19 passed (new astral case fails on the base revision)npm run test:localon the Apple, Android, Harmony and projection domain tests — 6 files, 126 passednpm run test:focusedon the boundary/acceptance tests touching these projections (tests/boundary/filesystem/{appleApplication,android/application,harmony/application}.test.ts,tests/acceptance/applications/mobileFrameworkConventions.test.ts,tests/boundary/cli/jsonInputStatus.test.ts, plusArtifactOccurrenceIdentity.test.ts) — 7 files, 92 passednpm run check:fast— typecheck and lint passedoxfmt --checkon changed files — cleannpm run build:cached— output aboveCompatibility, safety, and release
Author readiness
Human owner: @Sriram-PR
Before merge
type(scope): outcome.