Skip to content

feat: install + OS integration + full test/bench pyramid + widget - #38

Merged
hyperpolymath merged 1 commit into
mainfrom
claude/neurophone-install-integrate-RIcRa
May 2, 2026
Merged

feat: install + OS integration + full test/bench pyramid + widget#38
hyperpolymath merged 1 commit into
mainfrom
claude/neurophone-install-integrate-RIcRa

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

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

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
@hyperpolymath
hyperpolymath merged commit 5ef7cd2 into main May 2, 2026
21 of 31 checks passed
@hyperpolymath
hyperpolymath deleted the claude/neurophone-install-integrate-RIcRa branch May 2, 2026 18:47
@hyperpolymath
hyperpolymath restored the claude/neurophone-install-integrate-RIcRa branch May 11, 2026 07:28
Repository owner deleted a comment from chatgpt-codex-connector Bot May 13, 2026
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