Skip to content

Files Reviewed#1462

Merged
senamakel merged 10 commits into
tinyhumansai:mainfrom
rafaelfiguereod-stack:main
May 15, 2026
Merged

Files Reviewed#1462
senamakel merged 10 commits into
tinyhumansai:mainfrom
rafaelfiguereod-stack:main

Conversation

@rafaelfiguereod-stack
Copy link
Copy Markdown
Contributor

@rafaelfiguereod-stack rafaelfiguereod-stack commented May 10, 2026

Summary

  • Bumps sentry (and friends) in Cargo.toml/Cargo.lock to keep the Rust core on the current 0.x line.
  • Refreshes pnpm-lock.yaml to track those upstream dep updates.
  • Resolves a merge conflict in scripts/mock-api-core.mjs and restores the 30s MAX_MOCK_DELAY_MS cap in the refactored scripts/mock-api/state.mjs.
  • Repairs rand 0.10 API breakage across src/core/auth.rs, src/openhuman/security/pairing.rs, src/openhuman/memory/tree/tree_source/registry.rs, and src/openhuman/tools/impl/computer/human_path.rs so the Rust core compiles again.
  • Drops the contributor's added .github/workflows/codeql.yml — it conflicts with the upstream repo's CodeQL default setup ("CodeQL analyses from advanced configurations cannot be processed when the default setup is enabled") and breaks CI.

Problem

CI on the original branch was red: Analyze (ruby) / Analyze (javascript-typescript) from the new advanced CodeQL config rejected by GitHub, Rust core failing to compile against rand 0.10, and the merged-in mock-api-core.mjs left raw conflict markers that broke every test using the mock backend. Without this cleanup the dependency bumps could not land.

Solution

Sequenced fixes: resolved the mock-api conflict + lock files first, restored the Math.min(value, 30_000) delay cap that the earlier refactor dropped, removed "test" from the production sentry dep (kept only in [dev-dependencies]), migrated four call sites to the new rand 0.10 RngExt / rand::random() API, and removed the conflicting CodeQL workflow file.

Submission Checklist

  • N/A: dependency-bump + CI/compat fixes; no new behavior to test beyond what existing suites already cover (Vitest + Rust suites all pass)
  • N/A: diff coverage is for new behaviour; this PR is dependency churn + compile fixes with no added logic branches
  • N/A: no feature rows added/removed/renamed
  • N/A: no feature IDs touched
  • N/A: no new external network dependencies introduced
  • N/A: does not touch release-cut surfaces
  • N/A: no linked issue

Impact

  • Runtime: Rust core (desktop sidecar) now compiles against rand 0.10 and the bumped sentry line.
  • CI: removes the conflicting CodeQL advanced workflow so SARIF uploads stop failing; default setup at the repo level continues to provide equivalent scanning.
  • Test infra: mock backend is importable again; mock-delay cap restored to 30s as originally intended.

Related

  • Closes:
  • Follow-up PR(s)/TODOs:

AI Authored PR Metadata (required for Codex/Linear PRs)

Linear Issue

  • Key: N/A
  • URL: N/A

Commit & Branch

  • Branch: rafaelfiguereod-stack:main
  • Commit SHA: 93f6c126

Validation Run

  • pnpm --filter openhuman-app format:check
  • pnpm typecheck
  • Focused tests: pnpm test:unit (222 files, 2112 tests pass)
  • Rust fmt/check (if changed): cargo fmt --check + cargo check pass
  • Tauri fmt/check (if changed): cargo check --manifest-path app/src-tauri/Cargo.toml pass

Validation Blocked

  • command: N/A
  • error: N/A
  • impact: N/A

Behavior Changes

  • Intended behavior change: none (dependency bumps + compile/CI fixes)
  • User-visible effect: none

Parity Contract

  • Legacy behavior preserved: yes — mock-delay cap restored to original 30s; sentry test feature still present in [dev-dependencies]
  • Guard/fallback/dispatch parity checks: N/A

Duplicate / Superseded PR Handling

  • Duplicate PR(s): none known
  • Canonical PR: this PR
  • Resolution: N/A

rafaelfiguereod-stack and others added 7 commits May 10, 2026 14:39
…dates

Bumps the npm_and_yarn group with 1 update in the / directory: [basic-ftp](https://github.com/patrickjuchli/basic-ftp).


Updates `basic-ftp` from 5.3.0 to 5.3.1
- [Release notes](https://github.com/patrickjuchli/basic-ftp/releases)
- [Changelog](https://github.com/patrickjuchli/basic-ftp/blob/master/CHANGELOG.md)
- [Commits](patrickjuchli/basic-ftp@v5.3.0...v5.3.1)

Updates `fast-xml-builder` from 1.1.5 to 1.2.0
- [Changelog](https://github.com/NaturalIntelligence/fast-xml-builder/blob/main/CHANGELOG.md)
- [Commits](NaturalIntelligence/fast-xml-builder@v1.1.5...v1.2.0)

Updates `ip-address` from 10.1.0 to 10.2.0
- [Commits](https://github.com/beaugunderson/ip-address/commits)

---
updated-dependencies:
- dependency-name: basic-ftp
  dependency-version: 5.3.1
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: fast-xml-builder
  dependency-version: 1.2.0
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: ip-address
  dependency-version: 10.2.0
  dependency-type: indirect
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps the cargo group with 2 updates in the / directory: [openssl](https://github.com/rust-openssl/rust-openssl) and [rustls-webpki](https://github.com/rustls/webpki).


Updates `openssl` from 0.10.77 to 0.10.79
- [Release notes](https://github.com/rust-openssl/rust-openssl/releases)
- [Commits](rust-openssl/rust-openssl@openssl-v0.10.77...openssl-v0.10.79)

Updates `rustls-webpki` from 0.103.12 to 0.103.13
- [Release notes](https://github.com/rustls/webpki/releases)
- [Commits](rustls/webpki@v/0.103.12...v/0.103.13)

---
updated-dependencies:
- dependency-name: openssl
  dependency-version: 0.10.79
  dependency-type: indirect
  dependency-group: cargo
- dependency-name: rustls-webpki
  dependency-version: 0.103.13
  dependency-type: indirect
  dependency-group: cargo
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Potential fix for code scanning alert no. 5: Resource exhaustion
…arn/npm_and_yarn-9401a92e25

build(deps): bump the npm_and_yarn group across 1 directory with 3 updates
…go-83c3bdb6f7

build(deps): bump the cargo group across 1 directory with 2 updates
@rafaelfiguereod-stack rafaelfiguereod-stack requested a review from a team May 10, 2026 23:35
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 10, 2026

📝 Walkthrough

Walkthrough

Three dependency and utility updates: rand crate bumped from 0.9 to 0.10 in Cargo.toml, sentry test feature removed, auth token generation adapted to use the updated rand API with trace logging, and mock API delay values clamped to a 30-second maximum with a new exported constant.

Changes

Rust Dependency Updates and Compatibility

Layer / File(s) Summary
Cargo.toml Dependency Changes
Cargo.toml
Bumps rand crate from 0.9 to 0.10 and removes test feature from sentry dependency.
Auth Token Generation Compatibility
src/core/auth.rs
Updates generate_token to use RngExt::fill instead of RngCore::fill_bytes for random byte generation, adds trace logging at start and completion, and maintains the same 256-bit lowercase hex token format.

Mock API Delay Capping

Layer / File(s) Summary
Delay Constant and Clamping Logic
scripts/mock-api/state.mjs
Introduces MAX_MOCK_DELAY_MS constant set to 30,000 milliseconds and updates getDelayMs(key) to validate inputs and clamp finite positive delays to the maximum instead of allowing any positive value through.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A hop through the dependencies we go,
Rand bumped up and features to stow,
Auth tokens log their way so bright,
Mock delays capped just right,
Our burrow of code, now tight and sound!

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title "Files Reviewed" is vague and generic, providing no meaningful information about what changes were made or what aspect of the codebase was modified. Use a descriptive title that conveys the main purpose of the PR, such as "Update rand dependency to 0.10 and fix compatibility issues" or "Bump dependencies and fix rand 0.10 API changes".
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot]
coderabbitai Bot previously approved these changes May 10, 2026
@senamakel
Copy link
Copy Markdown
Member

really awesome PR @rafaelfiguereod-stack :D welcome to the club!

Copy link
Copy Markdown
Member

@senamakel senamakel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some gi actions are failing like unit tests. do review and fix

@senamakel senamakel self-assigned this May 14, 2026
…ck delay cap

Addresses CI failures and reviewer feedback on PR tinyhumansai#1462:

- fix(rand): update rand API calls to 0.10 compat
  - src/core/auth.rs: RngCore::fill_bytes → RngExt::fill
  - src/openhuman/security/pairing.rs: same
  - src/openhuman/memory/tree/tree_source/registry.rs: thread_rng().gen() → rand::random()
  - src/openhuman/tools/impl/computer/human_path.rs: Rng → RngExt bound, fix float type ambiguity
- fix(sentry): remove "test" feature from production sentry dep (Cargo.toml:113)
- fix(mock-api): add MAX_MOCK_DELAY_MS=30_000 cap in getDelayMs() (scripts/mock-api/state.mjs)
- fix(mock-api): add re-export shim at scripts/mock-api-core.mjs for backward compat
- chore: resolve merge conflicts in Cargo.lock, pnpm-lock.yaml, app/src-tauri/Cargo.lock
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/core/auth.rs`:
- Around line 181-184: Add trace-level entry/exit diagnostics around the
token-generation block (the code that creates `let mut bytes = [0u8; 32];
rand::rng().fill(&mut bytes); hex::encode(bytes)`) using the project's
tracing/log facility (e.g., tracing::trace! or log::trace!). Emit a stable
prefix like "token_generation:start" before filling `bytes` and
"token_generation:generated" after generation, and include only non-secret
metadata such as algorithm/entropy source or the token length (32) or a fixed
identifier — do NOT include `bytes`, the hex string, or any secret material in
the logs. Ensure the instrumentation is local to the token generation code path
(adjacent to the `rand::rng().fill(&mut bytes)` and `hex::encode(bytes)` calls)
and uses trace/debug level.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d1269cc0-2347-456d-9fcb-6b5cfe800de3

📥 Commits

Reviewing files that changed from the base of the PR and between e8d1388 and 3ec4145.

⛔ Files ignored due to path filters (2)
  • Cargo.lock is excluded by !**/*.lock
  • app/src-tauri/Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (3)
  • Cargo.toml
  • scripts/mock-api/state.mjs
  • src/core/auth.rs

Comment thread src/core/auth.rs Outdated
senamakel added 2 commits May 13, 2026 20:37
The upstream repo has CodeQL default setup enabled, which rejects SARIF
uploads from advanced configurations with: "CodeQL analyses from advanced
configurations cannot be processed when the default setup is enabled".

Removing the workflow restores green CI; default setup already provides
the equivalent scanning at the repo level.
Per CodeRabbit suggestion + CLAUDE.md "Debug logging" policy: emit
entry/exit `log::trace!` markers around the token generation flow with
a stable `[auth]` prefix. No secret material is logged — only counts.
@senamakel senamakel merged commit 21fd2cd into tinyhumansai:main May 15, 2026
25 of 27 checks passed
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