Skip to content

refactor: remove neuromod module, inline NeuromodNeuron in router - #30

Merged
rmems merged 2 commits into
mainfrom
no-neuromod-dependency
Jul 20, 2026
Merged

refactor: remove neuromod module, inline NeuromodNeuron in router#30
rmems merged 2 commits into
mainfrom
no-neuromod-dependency

Conversation

@rmems

@rmems rmems commented Jul 17, 2026

Copy link
Copy Markdown
Member

Removes the standalone src/neuromod.rs module and makes NeuromodNeuron a router-internal NIF integration primitive inside src/router.rs.

Changes

  • Move NeuromodNeuron into src/router.rs
  • Delete src/neuromod.rs and remove pub mod neuromod from src/lib.rs
  • Re-export NeuromodNeuron from router so the public API stays intact
  • Document the synaptic-mesh / neuromod crate boundary in src/lib.rs and README.md
  • Update REVIEW.md regression-guard paths
  • Add .devin/blueprint.yaml environment reference

Quality gate

  • cargo fmt --check — clean
  • cargo test --locked — 65 unit tests + 2 doc tests pass
  • cargo clippy --all-features -- -D warnings — clean
  • Regression guards and diff/origin hygiene pass

Summary by CodeRabbit

  • New Features
    • Added public modules for delay handling, mesh orchestration, error handling, topology, and shared types.
    • Kept neuromodulated routing support, with NeuromodNeuron now integrated via the routing API.
  • Documentation
    • Updated the README “Crate Boundary” and architecture notes to clarify cross-crate responsibilities.
    • Refreshed review/regression guidance to match the new module layout.
  • Tests
    • Added a regression test covering deserialization with missing NeuromodNeuron fields.
  • Chores
    • Added a development environment blueprint and updated .gitignore.

Summary by Gitar

  • Refactoring:
    • Added a regression test in src/tests.rs to ensure NeuromodNeuron correctly deserializes with default values when fields are missing.
    • Updated .gitignore to include AI-specific metadata directories .ai/ and .junie/.

This will update automatically on new commits.

- Move `NeuromodNeuron` into `src/router.rs` as a router-internal NIF primitive
- Delete `src/neuromod.rs` and remove `pub mod neuromod` from `lib.rs`
- Re-export `NeuromodNeuron` from `router` to preserve public API
- Document the `synaptic-mesh`/`neuromod` crate boundary in `lib.rs` and `README.md`
- Update `REVIEW.md` regression-guard paths and add `.devin/blueprint.yaml`
@rmems rmems linked an issue Jul 17, 2026 that may be closed by this pull request
6 tasks
@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The PR moves NeuromodNeuron into src/router.rs, removes the standalone neuromod module, updates public exports and tests, documents crate ownership, revises review checks, and adds a Devin environment blueprint.

Changes

NeuromodNeuron internalization

Layer / File(s) Summary
Router-local neuron implementation
src/router.rs
Defines the public serializable NeuromodNeuron type and its default initialization, integration, spike detection, reset, and gain update methods.
Public module and import wiring
src/lib.rs, src/tests.rs
Removes the neuromod module, adds public infrastructure modules, re-exports NeuromodNeuron through router, updates test imports, and adds deserialization recovery coverage.
Boundary and review guidance
README.md, src/lib.rs, REVIEW.md, .devin/blueprint.yaml, .gitignore
Documents crate ownership, updates regression and merge checks, adds Rust setup and validation commands, and ignores additional workspace paths.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related issues

  • Limen-Neural/synaptic-mesh issue 5 — Directly covers internalizing NeuromodNeuron, removing the module, updating exports, and documenting the crate boundary.

Suggested labels: bug, documentation

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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.
Title check ✅ Passed The title accurately describes the main refactor: removing the neuromod module and moving NeuromodNeuron into the router.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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

@amazon-q-developer amazon-q-developer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Summary

This PR successfully refactors the codebase by removing the standalone src/neuromod.rs module and inlining NeuromodNeuron as a router-internal primitive in src/router.rs. The changes maintain API compatibility while improving the architectural clarity between synaptic-mesh and the separate neuromod crate.

Changes Verified

✅ Module removal and code relocation executed correctly
✅ Public API preserved through re-exports in src/lib.rs
✅ All 67 tests passing (per PR description)
✅ Quality gates passed: cargo fmt --check, cargo test --locked, cargo clippy --all-features
✅ Documentation updated consistently across README.md, REVIEW.md, and source files
✅ Import paths updated correctly in test files

Architecture Impact

The refactoring clarifies the crate boundary: NeuromodNeuron is now explicitly documented as a router-internal NIF integration primitive, not a general-purpose neuron model. This separation ensures synaptic-mesh remains independent from the neuromod crate while maintaining its routing functionality.

No blocking issues found. The implementation is clean, well-tested, and ready to merge.


You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request removes the neuromod module and relocates the NeuromodNeuron struct to src/router.rs as a router-internal integration primitive, decoupling synaptic-mesh from the external neuromod crate. Documentation, tests, and environment blueprints are updated accordingly. Feedback suggests adding #[serde(default)] to the NeuromodNeuron struct to prevent deserialization failures on older or malformed serialized states before runtime self-healing can occur.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/router.rs
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 6 complexity · 0 duplication

Metric Results
Complexity 6
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@gitar-bot gitar-bot Bot added the gitar-approved Added by Gitar label Jul 17, 2026
gitar-bot[bot]
gitar-bot Bot previously approved these changes Jul 17, 2026

@gitar-bot gitar-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Gitar has auto-approved this PR (configure)

@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown

Qodana for Rust

It seems all right 👌

No new problems were found according to the checks applied

☁️ View the detailed Qodana report

Contact Qodana team

Contact us at qodana-support@jetbrains.com

@kilo-code-bot

kilo-code-bot Bot commented Jul 17, 2026

Copy link
Copy Markdown

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (8 files)
  • .devin/blueprint.yaml - new environment reference (docs-only)
  • README.md - crate boundary documentation
  • REVIEW.md - regression-guard paths updated for module move
  • src/lib.rs - removed pub mod neuromod, re-exports NeuromodNeuron from router
  • src/neuromod.rs - deleted (code moved to router.rs)
  • src/router.rs - inlined NeuromodNeuron + added #[serde(default)]
  • src/tests.rs - consolidated import + new deserialization regression test
  • .gitignore - ignore .ai/ and .junie/
Reconciled prior findings (resolved in current HEAD)
  • src/router.rs:35 (gemini) — missing #[serde(default)] on NeuromodNeuron: resolved in commit 339d80f, now present.
  • REVIEW.md (coderabbit) — re-export guard now matches the specific pub use router::{... NeuromodNeuron ...}; declaration: addressed in commit 339d80f.
Previous Review Summary (commit a0a15cf)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit a0a15cf)

Status: No Issues Found | Recommendation: Merge

Files Reviewed (7 files)
  • .devin/blueprint.yaml - new file, Devin environment blueprint (documentation-only)
  • README.md - crate boundary documentation added
  • REVIEW.md - regression guard paths updated for module move
  • src/lib.rs - removed pub mod neuromod, updated re-exports to pull NeuromodNeuron from router, updated doc comments
  • src/neuromod.rs - deleted (code moved to router.rs)
  • src/router.rs - inlined NeuromodNeuron struct + impls (verbatim from neuromod.rs), removed cross-module import
  • src/tests.rs - consolidated import to use crate::router::{..., NeuromodNeuron, ...}

Reviewed by hy3:free · Input: 40.8K · Output: 2.2K · Cached: 124.3K

Review guidance: REVIEW.md from base branch main

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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 `@REVIEW.md`:
- Line 35: Update the NeuromodNeuron verification in REVIEW.md to match the
specific public declaration `pub use router::{... NeuromodNeuron ...};` rather
than searching for the symbol anywhere in src/lib.rs. Ensure the check confirms
the re-export remains present at its expected location.
🪄 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: efbb957d-64e8-41a6-9838-5408b8866830

📥 Commits

Reviewing files that changed from the base of the PR and between baffa4c and a0a15cf.

📒 Files selected for processing (7)
  • .devin/blueprint.yaml
  • README.md
  • REVIEW.md
  • src/lib.rs
  • src/neuromod.rs
  • src/router.rs
  • src/tests.rs
💤 Files with no reviewable changes (1)
  • src/neuromod.rs

Comment thread REVIEW.md Outdated
@rmems rmems self-assigned this Jul 20, 2026
@rmems rmems added modularization Work to make repos more modular and overlapping neuromod Related to neuromod core labels Jul 20, 2026
@rmems rmems added this to Rust stack Jul 20, 2026
@github-project-automation github-project-automation Bot moved this to To triage in Rust stack Jul 20, 2026
@rmems

rmems commented Jul 20, 2026

Copy link
Copy Markdown
Member Author

Local CI/CD quality checks ✅

I ran the following checks locally against the PR:

  • cargo fmt --all -- --check — passed; no formatting changes required.
  • cargo check --workspace --all-targets --all-features — passed.
  • cargo clippy --workspace --all-targets --all-features -- -D warnings — passed with warnings treated as errors.
  • cargo test --workspace --all-features — passed:
    • 65 unit tests passed.
    • 2 documentation tests passed.
    • 0 failures, 0 ignored tests.
  • RUSTDOCFLAGS='-D warnings' cargo doc --workspace --all-features --no-deps — passed; documentation warnings are treated as errors.
  • cargo build --workspace --all-features — passed.
  • cargo package --allow-dirty — passed; the crate packaged and verified successfully.

Result

The PR passes the local formatting, compilation, linting, test, documentation, build, and packaging checks. No issues were found in this validation run.

Co-authored-by: Junie <junie@jetbrains.com>

@gitar-bot gitar-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Gitar has auto-approved this PR (configure)

@rmems
rmems merged commit 1486191 into main Jul 20, 2026
7 checks passed
@rmems
rmems deleted the no-neuromod-dependency branch July 20, 2026 12:13
@github-project-automation github-project-automation Bot moved this from To triage to Done in Rust stack Jul 20, 2026
@gitar-bot

gitar-bot Bot commented Jul 20, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Inlines NeuromodNeuron into the router module to simplify dependency management while maintaining public API consistency. The update adds necessary deserialization resilience for router neurons and cleans up project metadata.

Auto-approved: No blocking issues found.
Please see Auto-approve Docs for details on setting custom approval criteria.

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing less information.

Comment with these commands to change the behavior for this request:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Important

Your trial ends in 1 day — upgrade now to keep code review, CI analysis, auto-apply, custom automations, and more.

Was this helpful? React with 👍 / 👎 | Gitar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gitar-approved Added by Gitar modularization Work to make repos more modular and overlapping neuromod Related to neuromod core

Projects

No open projects
Archived in project

Development

Successfully merging this pull request may close these issues.

Internalize NeuromodNeuron as router-internal type (no neuromod dependency)

1 participant