Commit 5ef7cd2
feat: install + OS integration + full test/bench pyramid + widget (#38)
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
Co-authored-by: Claude <noreply@anthropic.com>1 parent 3229a57 commit 5ef7cd2
49 files changed
Lines changed: 3004 additions & 72 deletions
File tree
- android/app/src/main
- java/ai/neurophone
- widget
- res
- drawable
- layout
- values
- xml
- crates
- bridge
- benches
- src
- tests
- claude-client
- benches
- tests
- esn
- benches
- tests
- llm
- benches
- src
- tests
- lsm/tests
- neurophone-core
- benches
- tests
- sensors
- benches
- src
- tests
- docs
- scripts
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | | - | |
| 25 | + | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
318 | 318 | | |
319 | 319 | | |
320 | 320 | | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
0 commit comments