chore(deps): bump rand_distr from 0.5.1 to 0.6.0#67
Merged
Conversation
Bumps [rand_distr](https://github.com/rust-random/rand_distr) from 0.5.1 to 0.6.0. - [Release notes](https://github.com/rust-random/rand_distr/releases) - [Changelog](https://github.com/rust-random/rand_distr/blob/master/CHANGELOG.md) - [Commits](rust-random/rand_distr@0.5.1...0.6.0) --- updated-dependencies: - dependency-name: rand_distr dependency-version: 0.6.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
🔍 Hypatia Security ScanFindings: 25 issues detected
View findings[
{
"reason": "No test directory or test files found",
"type": "no_tests",
"file": "/home/runner/work/neurophone/neurophone",
"action": "flag",
"rule_module": "honest_completion",
"severity": "high",
"deduction": 20
},
{
"reason": "Issue in quality.yml",
"type": "missing_workflow",
"file": "quality.yml",
"action": "create",
"rule_module": "workflow_audit",
"severity": "high"
},
{
"reason": "Issue in security-policy.yml",
"type": "missing_workflow",
"file": "security-policy.yml",
"action": "create",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Action hyperpolymath/standards/.github/workflows/governance-reusable.yml@main needs attention",
"type": "unpinned_action",
"file": "governance.yml",
"action": "pin_sha",
"rule_module": "workflow_audit",
"severity": "high"
},
{
"reason": "unwrap() without prior check -- DoS via panic (1 occurrences, CWE-754)",
"type": "unwrap_without_check",
"file": "/home/runner/work/neurophone/neurophone/crates/sensors/src/lib.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "high"
},
{
"reason": "unwrap() without prior check -- DoS via panic (12 occurrences, CWE-754)",
"type": "unwrap_without_check",
"file": "/home/runner/work/neurophone/neurophone/crates/sensors/benches/sensors_bench.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "high"
},
{
"reason": "unwrap() without prior check -- DoS via panic (5 occurrences, CWE-754)",
"type": "unwrap_without_check",
"file": "/home/runner/work/neurophone/neurophone/crates/llm/benches/llm_bench.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "high"
},
{
"reason": "unwrap() without prior check -- DoS via panic (2 occurrences, CWE-754)",
"type": "unwrap_without_check",
"file": "/home/runner/work/neurophone/neurophone/crates/lsm/src/lib.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "high"
},
{
"reason": "expect() in hot path (1 occurrences, CWE-754)",
"type": "expect_in_hot_path",
"file": "/home/runner/work/neurophone/neurophone/crates/lsm/src/lib.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "medium"
},
{
"reason": "expect() in hot path (1 occurrences, CWE-754)",
"type": "expect_in_hot_path",
"file": "/home/runner/work/neurophone/neurophone/crates/lsm/benches/lsm_bench.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "medium"
}
]Powered by Hypatia Neurosymbolic CI/CD Intelligence |
hyperpolymath
added a commit
that referenced
this pull request
Jun 6, 2026
## Summary Sub-PR #4 of the Android Kotlin→Rust/Gossamer migration (epic #83, RFC #97, sub-issue #110). Implements the native (`neurophone_android`) JNI surface, replacing the `pub fn hello()` stub with the full 11-method `ai.neurophone.NativeLib` contract. The most independent step of the migration — no Service/widget/UI code is touched. Each `Java_ai_neurophone_NativeLib_*` export decodes its JVM arguments and delegates to the existing pure-Rust workspace crates: - `neurophone-core` (`NeuroSymbolicSystem`) — lifecycle, sensor processing, neural context, state, hybrid query router. - `llm` (`MockBackend`) — on-device LLM stand-in (`llama.cpp` swaps in later). - `claude-client` (`HybridInference` / `ClaudeClient`) — cloud path, with a graceful "no API key" branch. - `sensors` (`SensorKind`) — Android sensor-type id mapping. ### JNI contract implemented (class `ai.neurophone.NativeLib`, lib `neurophone_android`) `init(String?)->bool`, `start()->bool`, `stop()->void`, `processSensor(int, float[], long, int)->bool`, `queryLocal(String)->String`, `queryClaude(String)->String`, `query(String, bool)->String`, `getNeuralContext()->String`, `getState()->String(JSON)`, `reset()->void`, `isRunning()->bool`. Sensor-type id map per spec: accelerometer=1, magnetometer=2, gyroscope=4, light=5, proximity=8, else unknown (rejected). ## Files changed - **`crates/neurophone-android/src/lib.rs`** — full JNI implementation (was a stub). A `Mutex`-guarded process-global `NativeRuntime` singleton; safe `core_*` functions hold all logic; thin `unsafe extern "C"` exports decode args and delegate. 7 unit tests. - **`crates/neurophone-android/Cargo.toml`** — add `claude-client` and `llm` path deps. - **`Cargo.toml`** (workspace) — pin `jni = "0.21"`; revert `rand`/`rand_distr` to `0.9`/`0.5` (see Risks). - **`Cargo.lock`** — refreshed (`jni 0.21.1`, `rand 0.9.4`). The Kotlin/Java bindings (`NativeLib.kt`, `MainActivity.kt`) are intentionally **left untouched** — reconciled in the shim PRs / legacy-delete step. Marked `TODO(#83)` in code. ## Unsafe-on-JNI-boundary justification The crate is `#[deny(unsafe_code)]`. The JVM resolves native methods by C symbol name (`Java_<class>_<method>`), which requires `#[unsafe(no_mangle)]` + `unsafe extern "C"` — there is no safe-Rust spelling of an exported C-ABI symbol, and the `jni` handles are raw JVM-provided values. So: - The crate-level lint was relaxed from `forbid` to `#[deny(unsafe_code)]`. - Each JNI export carries a **local, documented** `#[allow(unsafe_code)] // JNI ABI: see module-level justification.` - Every export body immediately hands off to a safe `core_*` function and performs **no** `unsafe` operations beyond the ABI declaration. The `unsafe` surface is purely the entry-point signatures, confined to the `jni_boundary` module. ## What I verified - `cargo build --workspace` — green. - `cargo test --workspace` — green: **32 test binaries, all pass**, incl. 7 new tests here (sensor id map, config fallback, init/start/stop/reset lifecycle, sensor arity/type validation, local/cloud/hybrid query paths, JSON state shape, and pre-init safety). - `cargo clippy -p neurophone-android --all-targets` — no warnings. - `nm -D libneurophone_android.so` — all **11** `Java_ai_neurophone_NativeLib_*` symbols exported. ## TODOs / risks - **`rand`/`rand_distr` revert (pre-existing breakage).** Dependabot PRs #49/#67 bumped `rand 0.9→0.10` and `rand_distr 0.5→0.6`, but `ndarray-rand 0.16` still requires `rand 0.9`. This breaks `esn`/`lsm` the moment the lockfile is refreshed; the committed `Cargo.lock` pinned `rand 0.9.4`, which masked the regression. I reverted to `0.9`/`0.5` (with an explanatory `NOTE(#83)` in `Cargo.toml`) so the workspace builds. Re-bump only alongside an `ndarray-rand` upgrade that supports `rand 0.10`. Happy to split this into its own commit/PR if preferred. - **`jni` pinned to 0.21.** The workspace previously declared `0.22`, whose native-method API was reworked around `EnvUnowned::with_env` and is still settling. 0.21's `JNIEnv`-first-arg surface keeps the FFI boundary small and auditable. Only `neurophone-android` consumes `jni`, so the blast radius is nil. Revisit when 0.22's API stabilises. - **`MockBackend` for local LLM** is a deterministic stand-in; real `llama.cpp` wiring is out of scope (tracked separately). - **`queryClaude`** builds a short-lived current-thread tokio runtime per call and requires an API key from the environment; without one it returns a clear `[claude-unavailable]` string rather than failing the FFI call. Per-call runtime is fine for the current call pattern; revisit if it becomes hot. - **Kotlin still references these symbols** — binding declarations deliberately left as-is for the shim/legacy-delete PRs (`TODO(#83)`). https://claude.ai/code/session_01Gu1JFCZHuBtBhAWPr4sMQw --- _Generated by [Claude Code](https://claude.ai/code/session_01Gu1JFCZHuBtBhAWPr4sMQw)_ Signed-off-by: Jonathan D.A. Jewell <6759885+hyperpolymath@users.noreply.github.com> Co-authored-by: Claude <noreply@anthropic.com>
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.
Bumps rand_distr from 0.5.1 to 0.6.0.
Changelog
Sourced from rand_distr's changelog.
Commits
61d08aaUpdate rand 0.10 (#50)c97a8f5Merge pull request #46 from mstoeckl/gamma-avoid-nandf52389Merge pull request #51 from rust-random/push-qyyzynmpkuuo35ecffeCHANGELOG fixes06f586eMerge pull request #48 from mstoeckl/update-rand7540326Merge pull request #49 from rust-random/push-kzzruutkmsxsa101e4eAdd PR links to the CHANGELOGdf2bae8Update rand dependency to latest rcbe28239Merge pull request #41 from mstoeckl/zipf-edge-case9a8000bAvoid hangs and debug asserts on invalid parameters for ZipfDependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebasewill rebase this PR@dependabot recreatewill recreate this PR, overwriting any edits that have been made to it@dependabot show <dependency name> ignore conditionswill show all of the ignore conditions of the specified dependency@dependabot ignore this major versionwill close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor versionwill close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependencywill close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)