Skip to content

fix(mobile): bound framework conventions to path segments - #1506

Merged
morluto merged 2 commits into
morluto:mainfrom
thangldw:codex/bound-mobile-framework-conventions
Oct 10, 2026
Merged

morluto merged 2 commits into
morluto:mainfrom
thangldw:codex/bound-mobile-framework-conventions

Conversation

@thangldw

Copy link
Copy Markdown
Contributor

Closes #1489.

Android and Apple inventory projections used substring matches to infer framework families and bridge bases. For example, libcommunity.so was labelled Unity and MyApp.framework was labelled Flutter. Apple also inferred Swift/Objective-C from any dylib or framework-shaped path.

Use one bounded convention matcher per platform for both runtime-family hints and bridge bases. Android matches complete known library filenames; Apple matches complete known framework segments. Generic App.framework no longer identifies Flutter by itself, and generic dylib/framework paths no longer establish Swift/Objective-C. Keep the existing result schemas and inventory/candidate coverage semantics. Apple limitations now explicitly identify runtime families as inventory-derived hints and explain that a bridge basis comes only from the native path and repeats for each paired script.

Validation:

  • The new compiled CLI/real stdio MCP regression failed on the original code, reproducing incorrect bridge bases and runtime families.
  • 26 tests passed across four files: the new acceptance journey, Android/Apple composition and coverage, and Apple domain projection.
  • Acceptance uses source-owned APK/IPA ZIP fixtures, real artifact inventories, misleading names, known positive conventions, multiple paired components, exact runtime-family expectations, and identical CLI/MCP Evidence.
  • npm run check, npm run docs:check, npm run verify:test-discovery, and git diff --check passed.

The checks establish portable inventory projection behavior. They do not execute Android/iOS apps, decode language metadata, or verify actual framework loading. Implementation was developed with AI-agent assistance and verified with the checks above.

@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.

@CassieFox23

CassieFox23 commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

TL;DR: This PR fixes the Android half of #1489 in my test. On main, libcommunity.so was a Unity bridge and libpreact.so was React Native. On this PR both are plain JNI libraries, and real Unity, Flutter and React Native names still match.

I used WordleSolver (GPL-3.0-only) from F-Droid. I rebuilt it with four fake native libraries, then ran inspect-artifact and project-android-application-graph.

native path basis on main 983b070d4 basis on PR 56ebb97a3
lib/arm64-v8a/libcommunity.so unity-convention jni-library-convention
lib/arm64-v8a/libpreact.so react-native-convention jni-library-convention
lib/reactivity/libfoo.so react-native-convention jni-library-convention
lib/arm64-v8a/libplain.so (control) jni-library-convention jni-library-convention

On main, runtime_families was ["dalvik-art","native"] while the bases said Unity and React Native. Main disagreed with itself there. On the PR, the only output change is those three basis lines.

Real framework names still match

A second copy has classes2.dex and libunity.so, libflutter.so, libhermes.so and libreactnativejni.so. That gives 8 pairs: 2 dex files times 4 libraries.

check main PR
runtime_families ["dalvik-art","flutter","native","react-native","unity"] same as main
bases (8 pairs) flutter ×2, react-native ×4, unity ×2 same as main
full projection, minus projection_id — identical to main
WordleSolver with no libs — same as main

Tests and Node versions

check Node 22.23.1 Node 24.18.0 Node 26.11.1
new mobileFrameworkConventions.test.ts on the PR 1 passed 1 passed 1 passed
same test copied onto main — 1 failed (Android bases and families) —
PR projections match across Node yes yes yes

On main, the test fails at its Android check. Main also added flutter and react-native to runtime_families. Your fixture names libflutter.so.backup.so and libhermesfake.so caused that. So the family matcher on main was loose too, not just the basis.

Not run

Edit: npm run check and docs:check ran on 56ebb97a, in a late note. Still not run: real native libraries and real apps.

Edit: the Apple half ran with fake .ipa files, in the follow-up. This PR fixes it too. Still not run: npm run check, docs:check, real native libraries and real apps.

  • The Apple half: App.framework, MyApp.framework, and bare .dylib paths. I had no Apple material. Ran with 30 fake .ipa files.
  • npm run check and npm run docs:check. Both pass on 56ebb97a.
  • Real native libraries. Mine are 64-byte fake ELF headers, since the projection only reads paths.

Thanks, thangldw, for the fix and the acceptance test.

Edit: The sources for WordleSolver do not agree on its licence. F-Droid says GPL-3.0-only, the repo's LICENSE file says Apache-2.0, and the source headers say GPL-3.0-or-later.

Commands
rea inspect-artifact solver-libs.apk --format json
rea project-android-application-graph '{"inventory_evidence":[<substeps[0].evidence>]}' --format json
npm run test:focused -- tests/acceptance/applications/mobileFrameworkConventions.test.ts
Test setup
  • Box: Nobara 44 (Fedora 44 base), Linux 7.2.9
  • CPU: AMD Ryzen 9 5900X, 12 cores / 24 threads
  • Node: 22.23.1, 24.18.0, 26.11.1
  • Head / base: 56ebb97a3 / a0e5e9db2, compared with main 983b070d4
  • App: WordleSolver 1.13 from F-Droid, which is GPL-3.0-only
  • APK hash: same as the F-Droid index

🤖 Generated with Claude Code (Opus 5.5) 🦊

@CassieFox23

CassieFox23 commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

TL;DR: This PR fixes the Apple half of #1489 too. On main, names like Community.framework, MyApp.framework and an app called Reactor.app got Unity, Flutter or React Native labels; on this PR none of them do. Real framework names still match, and swift-objective-c is no longer reported at all.

I built 30 small fake .ipa files and ran inspect-artifact and project-apple-application-graph on main 7a56fe626 and on this PR. 28 of the 30 apps have one www/index.js, so every native file gets a bridge pair. Both commands exited 0 for every app on both trees.

Names that only contain a convention

Each row is its own .ipa. "Generic" means javascript-and-native-content.

path in the app basis on main family main added
Frameworks/Unityfoo.framework unity none
Frameworks/Community.framework unity none
Frameworks/MyUnityFramework.framework unity unity
Frameworks/MyFlutterHelpers.framework flutter none
Frameworks/MyFlutter.framework flutter flutter
Frameworks/Flutter.framework.backup/Flutter flutter flutter
Frameworks/MyApp.framework flutter flutter
Frameworks/Preact.framework react-native react-native
Frameworks/NotReact.framework react-native react-native
reactivity/libfoo.dylib react-native none
Frameworks/HermesExtra.framework generic react-native
app binary of Reactor.app react-native none
app binary of Community.app unity none

On the PR, every row above is generic. The family list is just javascript, native for all 13 apps. One app with all 11 framework and dylib names in it gave the same result. A main.jsbundle.bak file got no label on either side.

Real framework names still match on this PR. The table is in a fold below.

What else changed

  • swift-objective-c is gone. On main, any .dylib or file in a .framework added it. That covered libz.dylib, libswiftCore.dylib and a plain Generic.framework. On the PR it never shows up, and a new limitation line says why. The schema still lists swift-objective-c, but no path can reach it now.
  • hermes.framework is now a React Native bridge. On main its basis was generic while the family list said react-native, so main disagreed with itself.
  • App.framework alone no longer means Flutter. With Flutter.framework beside it, the family is still flutter.
  • Every app gained the same 3 limitation lines. Nothing else in the output moved: components, bundles, counts and coverage match main. On the plain app, the limitation lines are the only change.

Still not run

Edit: npm run check and docs:check ran on 56ebb97a, in a late note. Still not run: real iOS apps, Mac apps and DMG files.

  • Real iOS apps. Mine are fake, with tiny arm64 Mach-O headers built by the repo's MachoImage.fixture.ts.
  • Mac .app folders and DMG files. I have no Mac.
  • npm run check and npm run docs:check. Both pass on 56ebb97a.

Thanks, thangldw, for fixing the Apple side in the same PR, and for the clear new limitation lines.

Real names, main and this PR
path in the app basis on main basis on PR family on PR
UnityFramework.framework unity unity unity
Flutter.framework flutter flutter flutter
Flutter.framework inside Outer.framework flutter flutter flutter
React.framework react-native react-native react-native
ReactNative.framework react-native react-native react-native
hermes.framework generic react-native react-native
App.framework beside Flutter.framework flutter generic flutter
App.framework alone flutter generic none
plain app, no frameworks generic generic none
Node versions and plist formats
check Node 22.23.1 Node 24.18.0 Node 26.11.1
all 30 apps, main and PR not run exit 0, all 60 app runs not run
app with all 11 names: same output on each Node yes yes yes
app with all real names: same output on each Node yes yes yes

XML and binary Info.plist copies of the two combined apps gave the same labels.

Noticed, not part of this PR

REA lists main.jsbundle as a plain resource on main and on the PR. Only .js, .mjs and .cjs count as JavaScript. So an app with main.jsbundle and hermes.framework gets react-native, but no javascript family and no bridge pairs. That is why 28 of my 30 apps carry a www/index.js.

Commands
rea inspect-artifact neg-myapp.ipa --format json
rea project-apple-application-graph graphin.json --format json
# graphin.json = {"inventory_evidence":[<substeps[0].evidence>]}
Test setup
  • Box: Nobara 44 (Fedora 44 base), Linux 7.2.9
  • CPU: AMD Ryzen 9 5900X, 12 cores / 24 threads
  • Node: 22.23.1, 24.18.0, 26.11.1
  • Head / base: 56ebb97a3 / a0e5e9db2, compared with main 7a56fe626
  • Main moved from 983b070d4 since my first comment. The projection and inventory files did not change in between.
  • Fixtures: Python 3.14.7 (PSF-2.0), zipfile and plistlib

🤖 Generated with Claude Code (Opus 5.5) 🦊

@morluto

morluto commented Oct 10, 2026

Copy link
Copy Markdown
Owner

Thanks @thangldw for tightening mobile framework detection to path segments and adding regression coverage! Squash merged. I appreciate both this fix and your PE resource work in #1482.

@CassieFox23

CassieFox23 commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

TL;DR: A late note for the record. Before the last commit, npm run check and npm run docs:check both passed on 56ebb97a3. I did not rerun them on the merged code.

Both ran on Node 24.18.0 in a full clone. Lint printed warnings but no errors.

Not run

  • Any check on the merged code or on 843354b1.
  • The full test suite.
  • Real native libraries and real apps.
  • Windows and macOS.
Test setup
  • Box: Nobara 44 (Fedora 44 base), Linux 7.2.9
  • CPU: AMD Ryzen 9 5900X, 12 cores / 24 threads
  • RAM: 32 GB
  • Node: 24.18.0
  • Head tested: 56ebb97a3

🤖 Generated with Claude Code (Sonnet 5.5, verified by Opus 5.5) 🦊

@thangldw
thangldw deleted the codex/bound-mobile-framework-conventions branch October 12, 2026 10:30
@morluto morluto added the bug Something isn't working label Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(mobile): bound bridge and runtime-family conventions to path segments

3 participants