feat: install + OS integration + full test/bench pyramid + widget#38
Merged
Merged
Conversation
Realises the "install Neurophone on phone, integrate with OS, deploy full testing and benching" task end-to-end: Build / deps - Pin rand/rand_distr to versions compatible with ndarray-rand 0.16 (workspace was previously broken: the rand 0.10/0.9 cross-version trait collision left lsm and esn uncompilable). Subcrate implementations - Replaced the sensors/, bridge/, llm/ stub crates with real but minimal implementations: per-channel IIR filters + windowed feature extractor; salience/urgency encoder with NL description; LlmBackend trait with a deterministic MockBackend so the rest of the workspace is testable without a 700 MB model file. Testing pyramid (28 → 139 tests, 0 failures) - Per-module unit tests in every crate. - Point-to-point integration tests at crate boundaries. - End-to-end pipeline tests through neurophone-core composing the real sensors + lsm + esn + bridge + llm crates. - Aspect tests: concurrency (Arc<Mutex<...>>), timing, error paths, resource bounds. - Lifecycle tests: init / start / run / shutdown / restart. Bench coverage (8 criterion targets) - sensors_bench, bridge_bench, llm_bench, claude_bench, esn_bench, lsm_bench (existing), neurophone_bench (existing), pipeline_bench (new E2E sensor → LLM step bench). - TESTING-REPORT.adoc updated with median timings and frame-budget analysis (full non-LLM pipeline ~2.6 ms vs 20 ms 50 Hz budget). Home-screen widget - NeurophoneAppWidget (provider) + NeurophoneWidgetActions (state IPC) + NeurophoneWidgetConfigureActivity (first-run config). - 3×2 cell layout: power toggle, refresh, salience progress bar, "Ask NeuroPhone" button. - res/xml/neurophone_widget_info.xml, layout, drawables, strings. OS integration - NeurophoneService: foreground service that owns the sensor → neural → LLM loop, registers SensorManager listeners at SENSOR_DELAY_GAME, computes a salience signal and pushes it to the widget every 1 s. - BootReceiver restarts the service after reboot if the user had it on. - AndroidManifest wired with FOREGROUND_SERVICE_DATA_SYNC, POST_NOTIFICATIONS, RECEIVE_BOOT_COMPLETED, WAKE_LOCK; intent filters for ASSIST, ACTION_SEND text/plain, deep link neurophone://query?q=... . - MainActivity.handleEntryIntent() handles widget tap / share / ASSIST / deep-link entry. - scripts/install-on-phone.sh — workstation ADB installer (build APK, push model, grant runtime perms, start service). - scripts/install-termux.sh — on-device Termux CLI installer. - scripts/start-on-boot.sh — Termux:Boot hook. - scripts/uninstall.sh — clean removal in either mode. - docs/OS_INTEGRATION.adoc documents every integration surface. Limitations - Cannot physically install on the user's phone from this sandbox (no ADB / network path to a device); user runs install-on-phone.sh from their workstation. APK build itself requires Android NDK + SDK, which is not present in this environment, but all Rust code builds and tests cleanly on host. https://claude.ai/code/session_012opuP3HehkjDkF1XQ8nFex
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.
Realises the "install Neurophone on phone, integrate with OS, deploy full
testing and benching" task end-to-end:
Build / deps
(workspace was previously broken: the rand 0.10/0.9 cross-version
trait collision left lsm and esn uncompilable).
Subcrate implementations
minimal implementations: per-channel IIR filters + windowed feature
extractor; salience/urgency encoder with NL description; LlmBackend
trait with a deterministic MockBackend so the rest of the workspace
is testable without a 700 MB model file.
Testing pyramid (28 → 139 tests, 0 failures)
sensors + lsm + esn + bridge + llm crates.
resource bounds.
Bench coverage (8 criterion targets)
lsm_bench (existing), neurophone_bench (existing), pipeline_bench
(new E2E sensor → LLM step bench).
analysis (full non-LLM pipeline ~2.6 ms vs 20 ms 50 Hz budget).
Home-screen widget
"Ask NeuroPhone" button.
OS integration
→ LLM loop, registers SensorManager listeners at SENSOR_DELAY_GAME,
computes a salience signal and pushes it to the widget every 1 s.
POST_NOTIFICATIONS, RECEIVE_BOOT_COMPLETED, WAKE_LOCK; intent
filters for ASSIST, ACTION_SEND text/plain, deep link
neurophone://query?q=... .
/ deep-link entry.
push model, grant runtime perms, start service).
Limitations
(no ADB / network path to a device); user runs install-on-phone.sh
from their workstation. APK build itself requires Android NDK +
SDK, which is not present in this environment, but all Rust code
builds and tests cleanly on host.
https://claude.ai/code/session_012opuP3HehkjDkF1XQ8nFex