Skip to content

fix(apple): order projection paths by Unicode code point - #3294

Merged
morluto merged 1 commit into
morluto:mainfrom
Sriram-PR:fix/apple-projection-code-point-order
Oct 14, 2026
Merged

morluto merged 1 commit into
morluto:mainfrom
Sriram-PR:fix/apple-projection-code-point-order

Conversation

@Sriram-PR

@Sriram-PR Sriram-PR commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary

project-apple-application-graph sorted application_roots, bundles[].path and symlinks with 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 that compareProjectionStrings documents.

Fixes #3177

Problem and expected behavior

Smallest trigger: two app roots A\u{10000}.app and A\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 (in mobileApplicationGraphProjection.ts) is removed. Its callers in the Apple, Android and Harmony projections now use the existing compareUnicodeCodePoints from unicodeCodePointOrder.ts, so there is a single owner for this ordering.
  • The private compare in appleBundleAnatomy.ts, used for roots, bundles and platforms, had the same code unit comparison and now uses compareUnicodeCodePoints too.
  • Android and Harmony only sort evidence ids and runtime family names with it, which are ASCII, so their output doesn't change.

Contribution scope: ordinary fix within existing boundaries; no scope decision needed.

Contract and boundary impact

  • Semantic owner and earliest changed stage: src/domain/unicodeCodePointOrder.ts (unchanged) becomes the only comparator for these projection arrays; change is in the domain projection stage.
  • Contribution scope fit and linked maintainer decision: not applicable (bug fix, [Bug] Apple application projection reverses Unicode code point order for astral paths #3177).
  • CLI and MCP/tool-catalog contract: no schema change. Array order changes only when names contain characters above U+FFFF mixed with BMP characters at or above U+E000.
  • Provider, bridge, target-format, or platform compatibility: none.
  • Evidence, artifact, provenance, or reconstruction contract: projection_id changes for affected inputs because the ordered payload changes; it stays deterministic.
  • Target selection, authority, upstream behavior, and cleanup details: not applicable.
  • Generated metadata, package, or installation impact: none.

Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

  • Tests added or updated: src/domain/apple/appleApplication.test.ts, a parameterized test with the astral/BMP pair from the issue and a BMP-only control. It checks application_roots, bundles[].path and symlinks.
  • Base reproduction: on the base revision the new astral case fails with expected [ 'A\ud800\udc00.app', 'A\ufffd.app' ] to deeply equal [ 'A\ufffd.app', 'A\ud800\udc00.app' ]; the BMP control passes.
  • User-visible CLI output: the issue's recipe (extended with a U+E000 root) through inspect-artifact and project-apple-application-graph now returns:
    application_roots: ["A\ue000.app", "A\ufffd.app", "A\ud800\udc00.app"]
    bundle_paths:      ["A\ue000.app", "A\ufffd.app", "A\ud800\udc00.app"]
    symlinks: [".../A\ue000.app/Contents/Resources/link", ".../A\ufffd.app/...", ".../A\ud800\udc00.app/..."]
    coverage: {"status":"complete-within-inventory","inventory_complete":true}
    
  • Remaining proof gaps: ran on Linux x64 only (the projection is pure domain code, no provider involved).

For evidence-bearing changes:

  • Observed, derived, and inferred claims remain distinguishable.
  • Artifact identity, source provenance, and failed attempts remain preserved.
  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

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:local on the Apple, Android, Harmony and projection domain tests — 6 files, 126 passed
  • npm run test:focused on 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, plus ArtifactOccurrenceIdentity.test.ts) — 7 files, 92 passed
  • npm run check:fast — typecheck and lint passed
  • oxfmt --check on changed files — clean
  • CLI repro from the issue after npm run build:cached — output above

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real Hopper/Ghidra, browser, or OS coverage: not applicable; Linux x64, Node 24.18.0.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: none; comparator change only.

Author readiness

Human owner: @Sriram-PR

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare the current revision ready for maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

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
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@greptile-apps

greptile-apps Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable defects were found.

Summary

The PR replaces duplicate UTF-16 comparators with compareUnicodeCodePoints.

  • Apple application paths follow Unicode code-point order.

No actionable correctness, security, or rule violations were found. Tests were inspected, not run. Superseded status could not be checked because GitHub access was unavailable.

Reviews (1) · Last reviewed commit: "fix(apple): order projection paths by Un..." · Reviewed by Greptile

@morluto
morluto merged commit 57290a0 into morluto:main Oct 14, 2026
1 check passed
@Sriram-PR
Sriram-PR deleted the fix/apple-projection-code-point-order branch October 14, 2026 08:35
@morluto morluto added the bug Something isn't working label Oct 14, 2026
@morluto

morluto commented Oct 15, 2026

Copy link
Copy Markdown
Owner

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!

@morluto morluto added the area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior label Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Apple application projection reverses Unicode code point order for astral paths

2 participants