build(#1580): ship the arm64-v8a/x86_64 Android JNI model host in the AAR (Decision 108, slice 3/3) - #1620
Merged
Conversation
… AAR (Decision 108, slice 3) - scripts/build_android_host_ndk.sh: cargo-ndk cross-build at API 28 with 16 KB page alignment; checks each .so exports exactly the audited JNI method and every LOAD segment is 16 KB aligned - Gradle packages build/jniLibs into the AAR (no committed binaries) - scripts/ci/android_aar_check.sh: the release AAR must carry both ABIs - CI job android-native-package runs the cross-build + AAR check on every full-CI PR; the Maven publish job cross-builds and verifies before publishing Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
enricopiovesan
enabled auto-merge (squash)
October 2, 2026 20:40
enricopiovesan
disabled auto-merge
October 2, 2026 20:41
enricopiovesan
enabled auto-merge (squash)
October 2, 2026 20:47
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Slice 3 of 3 for #1580 (Decision 108): the published
traverse-embedderAAR now ships the native model engine (libtraverse_android_host.so) forarm64-v8a(phones) andx86_64(emulators). Without it, every model call on a device fails closed withengine_unavailable.scripts/build_android_host_ndk.shcross-buildstraverse-android-hostwithcargo-ndk4.1.2 at API 28 (the embedder'sminSdk) into<jniLibs>/<abi>/. It uses the NDK fromANDROID_NDK_HOME/ANDROID_NDK_LATEST_HOME, which GitHub runners provide. It links with 16 KB page alignment (-z max-page-size=16384, required for Android 15+) and then verifies each library:Java_dev_traverse_embedder_ExactModelNative_modelCall, the one audited JNI method from ADR-0079;LOADsegment is aligned to0x4000.sourceSets["main"].jniLibs.srcDir(build/jniLibs), so the libraries ship inside the AAR and nothing binary is committed.scripts/ci/android_aar_check.shfails if the AAR lacks either ABI.android-native-packagejob (Ubuntu, Rust Android targets,cargo-ndk) cross-builds, assembles the release AAR, and runs the AAR check on every full-CI PR;publishToMavenCentral.governsgains both scripts.This machine has no Android NDK, so the cross-build itself is proven by this PR's new
android-native-packagejob. That was the CI-only option from the #1580 discussion.Governing Spec
138-governed-exact-model-execution068-public-platform-embedder-packages004-spec-alignment-gate065-sigstore-bundle-verification068covers the public Kotlin package build (build.gradle.kts) and the Maven publish workflow.004covers theapproved-specs.jsongovernsadditions and the CI scripts.065covers spec-alignment-gate coverage ofdocs/releases/next.md.Project Item
Closes #1580 (slice 3/3; slices 1–2 were #1613 and #1614). Emulator instrumented tests remain #1611.
Validation
build/jniLibs:gradle :traverse-embedder:assembleReleasepacksjni/arm64-v8a/…andjni/x86_64/…, andandroid_aar_check.shpasses. With one ABI removed, it fails withmissing jni/x86_64/libtraverse_android_host.so.bash -non both scripts; both workflows parse as YAML; the release naming check passes.android-native-packagejob.🤖 Generated with Claude Code