RFC: Android Kotlin → Rust/Tauri 2 migration#96
Conversation
Draft RFC for owner review before any bulk conversion. Maps each of the 7 Kotlin files + 3 *.gradle.kts to a Rust/Tauri replacement, calls out the unavoidable JVM-bytecode surface (Service / BroadcastReceiver / AppWidgetProvider), and proposes a 9-PR landing sequence gated on CI-exemption coordination for Tauri-generated Java shims under src-tauri/gen/android/. No Kotlin deleted, no Tauri scaffolding generated — pure planning artefact. Both banned-language CI gates remain red until the sequenced sub-PRs land in order. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Replaced by PR on chore/gossamer-migration-rfc — owner corrected the migration target from Tauri to Gossamer; rewriting under the right branch name. |
|
Two owner decisions for this RFC are now settled — please update the doc accordingly before any sub-PRs:
(Tracked on the neurophone side as #83, which now names gossamer.) Generated by Claude Code |
Status
DRAFT — RFC only. Awaiting owner review BEFORE any bulk conversion.
No Kotlin deleted, no Tauri scaffolding generated, no behaviour change.
Why
android/ships 7 Kotlin files + 3*.gradle.ktsfiles, all banned by theHyperpolymath language policy. This keeps two CI gates permanently red:
Check for Banned Languages(.github/workflows/language-policy.yml:87-94)governance / Language / package anti-pattern policy(estate-wide)What this PR contains
A single document —
docs/migrations/RFC-ANDROID-KOTLIN-TO-RUST.adoc— that:Activity,Service,BroadcastReceiver,AppWidgetProvider— that Android instantiates byclass name and that pure Rust cannot satisfy.
src-tauri/gen/android/, with a CI exemption analogous tonode_modules/) and explicitly rejects Paths B (drop the widget) andC (JVM bytecode emission from Rust).
Component mapping (one-line summary)
MainActivity.ktMainActivity+ AffineScript webview UINeurophoneService.ktServiceshim → JNI into RustBootReceiver.ktBroadcastReceivershim → JNINativeLib.ktcrates/neurophone-android/src/lib.rsNeurophoneAppWidget.ktAppWidgetProvidershimNeurophoneWidgetActions.ktBroadcastReceivershimNeurophoneWidgetConfigureActivity.ktActivityshim (or drop)*.gradle.ktsgen/android/Sub-PR sequence (proposed)
src-tauri/gen/android/(coordinated withhyperpolymath/standards).cargo tauri android initscaffolding.NativeLibKotlin →crates/neurophone-android/src/lib.rs.NeurophoneService.BootReceiver.activity_main.xml).android/tree — both CI gates green.PRs 2 & 3 sequenced; 4–7 parallelizable after 3; 8 needs 4; 9 gated on all.
Open questions for owner
src-tauri/gen/android/?callable in
hyperpolymath/standards?PMPL-1.0-or-later, local hook expectsMPL-2.0. Pick canonical before sub-PRs.Constraints honoured in this PR
flagged in the RFC's "Open questions". See open question chore(deps): update reqwest requirement from 0.11 to 0.12 #6.
Test plan
🤖 Generated with Claude Code