chore(android): scaffold Gossamer Android shell (#83 sub-PR #3)#126
Open
hyperpolymath wants to merge 2 commits into
Open
chore(android): scaffold Gossamer Android shell (#83 sub-PR #3)#126hyperpolymath wants to merge 2 commits into
hyperpolymath wants to merge 2 commits into
Conversation
Stand up the minimal Gossamer Android scaffolding so later sub-PRs can port the legacy Kotlin components. Scaffolding ONLY — no NativeLib, NeurophoneService, BootReceiver, or widgets (those are sub-PRs #4-#7). Adds under android/gossamer/: - gossamer.conf.json: Gossamer app config (analogous to tauri.conf.json), schema mirrored from hyperpolymath/gossamer and hyperpolymath/panll. - app/src/main/java/ai/neurophone/NeurophoneMainActivity.java: Java shim extending io.gossamer.GossamerActivity, loads placeholder HTML in the Gossamer WebView via getInitialHtml(). - Cargo.toml + src/lib.rs: standalone (non-workspace) scaffold crate. The gossamer-rs dependency is commented out because it is unpublished (estate consumes it as a path dep from the sibling gossamer repo). Kept OUT of the root workspace so cargo build/test --workspace are unaffected. - README.adoc: documents resolvability, GossamerActivity API assumptions, and TODOs/risks for sub-PRs #4-#8. The android/ subtree is exempt from the banned-language CI gate via .hypatia-baseline.json, so the hand-written Java shim is acceptable. Refs #83, #97, #109. https://claude.ai/code/session_01Gu1JFCZHuBtBhAWPr4sMQw
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.
Sub-PR #3 of the Android Kotlin→Rust/Gossamer migration epic (#83, RFC PR #97, tracking sub-issue #109). Scaffolding only. No behaviour change to existing crates; the legacy Kotlin
android/app/tree is untouched.Files added (all under
android/gossamer/, allSPDX-License-Identifier: MPL-2.0)gossamer.conf.jsontauri.conf.json). Schema mirrored fromhyperpolymath/gossamerandhyperpolymath/panll. Carries identityai.neurophone, thebundle.mobile.androidblock (minSdk 26 / targetSdk 34 + the permission set from the legacyAndroidManifest.xml), dev/build runner config.app/src/main/java/ai/neurophone/NeurophoneMainActivity.javaio.gossamer.GossamerActivity; overridesgetInitialHtml()to load placeholder HTML in the Gossamer WebView.Cargo.tomlneurophone-gossamercdylib.gossamer-rsdep commented out (see below).src/lib.rsREADME.adocGossamerActivityAPI assumptions, TODOs/risks for #4–#8.Cargo.lockThe
android/**subtree is exempt from the banned-language CI gate via.hypatia-baseline.jsononmain, so the hand-written Java shim is acceptable here.gossamer-rsresolvability outcomegossamer-rsv0.1.0 is NOT published to crates.io. In the estate it is consumed as a path dependency from the siblinghyperpolymath/gossamerrepo atbindings/rust— precedent fromhyperpolymath/panll:That sibling checkout doesn't exist in a neurophone clone, so wiring it as a hard dependency would break the build. Per the hard constraint (CI green > "complete" dep), it is left commented out with
TODO(#83 sub-PR #8). The scaffold manifest is also kept out of the root workspacemembersand carries an empty[workspace]table, so neithercargo build --workspacenorcargo test --workspaceever touches it.What I verified (build/test)
cargo metadata --no-depsfor the root workspace → the 8 existing crates only;neurophone-gossameris not a member. My additions are inert to the workspace.cargo test --manifest-path android/gossamer/Cargo.toml→ compiles + 1 test passes.cargo build --workspace/cargo test --workspacefail only incrates/esnandcrates/lsm(ndarray-rand0.16 vsrand0.10 API skew:random/sample/random_using). This failure pre-exists onmain— reproduced in a pristinemainworktree (cargo build -p esnexits 101 on0a88e45). My PR neither introduces nor worsens it.GossamerActivityAPI assumptions (read fromhyperpolymath/gossamerandroid/src/main/java/io/gossamer/)io.gossamer.GossamerActivity extends android.app.Activity.libgossamer.soviaSystem.loadLibrary("gossamer")in a static block.onCreate()builds a full-screenWebView, enables JS + DOM storage, disablesfile:///content access, registers theGossamerBridgeJS interface (window.GossamerBridge.postMessage(json)), and calls nativenativeInit(activity, webview).getInitialHtml()(HTMLString) orgetInitialUrl()(URLString);getInitialHtml()takes precedence — we override it.libgossamer.soare vendored/linked into the app module at build time (sub-PR chore(deps): bump the actions group with 9 updates #8), soio.gossamer.GossamerActivityis on the classpath. The shim is therefore not part of any CI build step yet.TODOs / risks for sub-PRs #4–#8
NativeLib: map the 11 JNI methods (init/start/stop/processSensor/queryLocal/queryClaude/query/getNeuralContext/getState/reset/isRunning) to Gossamer IPC command handlers calling the Rust core (crates/neurophone-core,crates/neurophone-android). IPC name/payload contract is undefined.NeurophoneServiceforeground sensor loop.BootReceiver.frontendDist) + full IPC wiring; enablegossamer-rs(resolve the sibling-checkout/build-integration question); decidegossamerCLI vs Gradle for the APK build; then remove the legacy Kotlinandroid/app/tree.gossamer-rsisAGPL-3.0-or-later; everything added here isMPL-2.0. Whether the cdylib linkinggossamer-rscan stay MPL-2.0 or must adopt a compatible license is an open question to resolve before chore(deps): bump the actions group with 9 updates #8.Refs #83, #97, #109.
https://claude.ai/code/session_01Gu1JFCZHuBtBhAWPr4sMQw
Generated by Claude Code