Skip to content

chore(android): scaffold Gossamer Android shell (#83 sub-PR #3)#126

Open
hyperpolymath wants to merge 2 commits into
mainfrom
chore/gossamer-scaffold-a
Open

chore(android): scaffold Gossamer Android shell (#83 sub-PR #3)#126
hyperpolymath wants to merge 2 commits into
mainfrom
chore/gossamer-scaffold-a

Conversation

@hyperpolymath
Copy link
Copy Markdown
Owner

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/, all SPDX-License-Identifier: MPL-2.0)

File Purpose
gossamer.conf.json Gossamer app config (analogous to tauri.conf.json). Schema mirrored from hyperpolymath/gossamer and hyperpolymath/panll. Carries identity ai.neurophone, the bundle.mobile.android block (minSdk 26 / targetSdk 34 + the permission set from the legacy AndroidManifest.xml), dev/build runner config.
app/src/main/java/ai/neurophone/NeurophoneMainActivity.java Java shim extending io.gossamer.GossamerActivity; overrides getInitialHtml() to load placeholder HTML in the Gossamer WebView.
Cargo.toml Standalone (non-workspace) scaffold manifest for the future neurophone-gossamer cdylib. gossamer-rs dep commented out (see below).
src/lib.rs Inert placeholder lib so the standalone crate compiles; documents wiring TODOs.
README.adoc Documents resolvability, GossamerActivity API assumptions, TODOs/risks for #4#8.
Cargo.lock Lock for the standalone scaffold crate (pins serde/serde_json placeholder deps).

The android/** subtree is exempt from the banned-language CI gate via .hypatia-baseline.json on main, so the hand-written Java shim is acceptable here.

gossamer-rs resolvability outcome

gossamer-rs v0.1.0 is NOT published to crates.io. In the estate it is consumed as a path dependency from the sibling hyperpolymath/gossamer repo at bindings/rust — precedent from hyperpolymath/panll:

gossamer-rs = { path = "../gossamer/bindings/rust" }

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 workspace members and carries an empty [workspace] table, so neither cargo build --workspace nor cargo test --workspace ever touches it.

What I verified (build/test)

  • cargo metadata --no-deps for the root workspace → the 8 existing crates only; neurophone-gossamer is not a member. My additions are inert to the workspace.
  • Standalone scaffold: cargo test --manifest-path android/gossamer/Cargo.tomlcompiles + 1 test passes.
  • cargo build --workspace / cargo test --workspace fail only in crates/esn and crates/lsm (ndarray-rand 0.16 vs rand 0.10 API skew: random/sample/random_using). This failure pre-exists on main — reproduced in a pristine main worktree (cargo build -p esn exits 101 on 0a88e45). My PR neither introduces nor worsens it. ⚠️ Pre-existing red workspace flagged below.

GossamerActivity API assumptions (read from hyperpolymath/gossamer android/src/main/java/io/gossamer/)

  • io.gossamer.GossamerActivity extends android.app.Activity.
  • Loads libgossamer.so via System.loadLibrary("gossamer") in a static block.
  • onCreate() builds a full-screen WebView, enables JS + DOM storage, disables file:///content access, registers the GossamerBridge JS interface (window.GossamerBridge.postMessage(json)), and calls native nativeInit(activity, webview).
  • Content via overriding getInitialHtml() (HTML String) or getInitialUrl() (URL String); getInitialHtml() takes precedence — we override it.
  • Gossamer on Android is webview-only today.
  • Assumed: the gossamer Android sources + libgossamer.so are vendored/linked into the app module at build time (sub-PR chore(deps): bump the actions group with 9 updates #8), so io.gossamer.GossamerActivity is on the classpath. The shim is therefore not part of any CI build step yet.

TODOs / risks for sub-PRs #4#8

Refs #83, #97, #109.

https://claude.ai/code/session_01Gu1JFCZHuBtBhAWPr4sMQw


Generated by Claude Code

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
@hyperpolymath hyperpolymath marked this pull request as ready for review June 3, 2026 21:08
@hyperpolymath hyperpolymath enabled auto-merge (squash) June 3, 2026 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants