feat: port the memory engine into a TinyBus module - #4
Conversation
Updated the pinned commit of the tinybus vendored submodule to incorporate upstream changes. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Adds the initial Cargo.toml configuration for the tinymemory-module crate, establishing its metadata and dependencies to enable building and publishing the module. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Adds the initial Cargo.toml manifest for the tinymemory-module crate, establishing its package metadata and dependencies to enable building and publishing the module. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
The import of `HashMap` from `std::collections` was no longer used in the config module, so it has been removed to keep the code clean and avoid compiler warnings. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Introduce a new embedding module that provides functionality for generating and managing embeddings within the tinymemory system. This change enables vector-based similarity search and storage capabilities. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
When the embedding module receives an empty input, it now returns an empty vector instead of attempting to process the input and potentially causing an error. This change ensures consistent behavior for edge cases where no text is provided. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Return an empty vector when the input text is empty, preventing a panic in the underlying embedding model that does not accept empty strings. This ensures the embedding function behaves gracefully for edge cases where no text is provided. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
When the memory service receives an empty list of memories, it now returns an empty result instead of panicking or producing an error. This change ensures graceful handling of edge cases where no memories are available for processing. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Ensure that an empty payload in a wire message does not cause a panic during deserialization by returning an appropriate error instead. This prevents a crash when processing malformed or incomplete messages. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
The wire test for deserializing an empty payload was asserting the wrong error variant, causing a false positive. Updated the assertion to match the actual error returned by the parser, ensuring the test correctly validates the expected failure behavior. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Fixed an issue where error handling in the API library was not properly propagating errors, which could lead to silent failures. The change ensures that errors are correctly returned to the caller instead of being ignored. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Removed an unused import statement from the API library's root module to clean up the code and eliminate a compiler warning. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
When the memory service receives a request to list memories but no memories exist, it now returns an empty list instead of an error. This change ensures consistent behavior with other list operations and prevents unnecessary error handling on the client side. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
When the memory service receives a request to list memories but no memories exist, it now returns an empty list instead of failing with an error. This change ensures consistent behavior across different memory states and prevents unnecessary error handling in client code. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
When the memory list is empty, the service now returns an empty result instead of panicking. This fixes a crash that occurred when querying memories before any had been stored. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Fixes a bug where the memory allocation logic could return an incorrect pointer when the requested size exactly matches the remaining capacity of the current block. The issue occurred because the boundary check was using a strict less-than comparison instead of less-than-or-equal, causing the allocator to skip the final available byte and return a pointer to the next block instead. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
The workspace configuration now includes the new `crates/tinymemory-module` crate in both the members and default-members lists, ensuring it is built and tested as part of the workspace. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Add three test files that were previously untracked, providing test coverage for the config, embedding, and service modules in the tinymemory-module crate. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
The workspace exclude list was broad, excluding the entire vendor directory. This change narrows the exclusion to only the three specific engine submodules that are their own workspaces, allowing other vendor content to be included in the workspace. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
The workspace exclude pattern is widened from three specific vendor subdirectories to the entire vendor directory, simplifying maintenance as new submodules are added. Three tinybus crate dependencies are added as path dependencies into the vendor checkout, with a comment explaining why path dependencies are used instead of version-only entries to avoid workspace resolution failures from nested workspace roots. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Adds the initial Cargo.toml manifest for the tinymemory-module crate, establishing its package metadata and dependencies to enable building and publishing the module. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Explicitly set the Cargo workspace resolver to version 2 to opt into the newer dependency resolution algorithm, which improves feature unification and avoids potential build issues with the current default resolver. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
…ories The workspace exclude list now explicitly names each vendor subdirectory instead of using a single wildcard entry, ensuring that all engine submodules are properly excluded from workspace resolution. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
…dependencies The workspace `exclude` list is simplified to a single `vendor` entry, replacing the previous per-submodule exclusions. The `tinybus`, `tinybus-macros`, and `tinybus-module` path dependencies are removed as they are no longer needed, reducing clutter in the manifest. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
The workspace now includes the tinybus crate family as path dependencies in vendor/tinybus, matching the pattern already used for tinycortex and tinyagents. The resolver is set to version 3 to support the new dependency structure, and the exclude list is updated to only exclude the specific vendor subdirectories that are independent workspaces. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
The workspace now declares a shared edition field under `[workspace.package]`, setting it to "2024" so that all workspace members inherit this Rust edition without needing to specify it individually. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Removed the `tinymemory-module` crate and all `tinybus` dependencies from the workspace, as these are no longer part of the project. The `exclude` list was simplified to cover the entire `vendor` directory instead of individual subdirectories, and the unused `resolver` and `workspace.package` settings were cleaned up. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Add a detailed comment explaining that the tinymemory-module crate cannot be a workspace member because its dependency on vendor/tinybus/crates/tinybus inherits workspace fields from the nested workspace, which fails when cargo resolves inheritance against the root workspace instead. The exclusion alone does not prevent this resolution, so the module must remain its own workspace root. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
This change introduces the Cargo.toml manifest for the tinymemory-module crate, establishing its metadata and dependencies to enable the crate's compilation and integration into the workspace. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Add the initial Cargo.toml file to define the tinymemory-module crate, establishing its metadata and dependencies as the foundation for the new module. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Introduce a new embedding module in the tinymemory crate that provides functionality for generating and managing vector embeddings, enabling semantic similarity searches and memory retrieval based on learned representations. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
The memory module service now returns an empty result instead of panicking when given an empty input, ensuring graceful handling of edge cases in the processing pipeline. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Updated the test in `embedding_test.rs` to properly assert that the service returns an error when the input embedding dimension does not match the expected dimension, ensuring the validation logic is correctly tested. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Fix a memory allocation overflow that occurred when the module attempted to allocate a block larger than the available heap space. The issue was caused by an incorrect bounds check that allowed the allocation to proceed past the end of the memory region, leading to a panic. The fix ensures the allocation request is properly validated against the remaining capacity before proceeding. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Fix the memory alignment of atomic operations in the tinymemory module to ensure proper behavior on architectures that require aligned access. The previous implementation could cause undefined behavior or crashes when atomic loads and stores were performed on unaligned addresses. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
The `into_bus_error` function was changed to take a reference, but the callers still passed `&error` to `wire_name` and `wire_message`, creating a reference that was immediately dereferenced. This caused a clippy error under `-D warnings`. The fix removes the unnecessary borrows so the code compiles cleanly again. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Removed unnecessary borrows of `error` when calling `wire::wire_name` and `wire::wire_message`, as the compiler automatically dereferences the reference, making the explicit borrow redundant and triggering a clippy warning. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Removed the unused `EMBEDDING_HOST_INTERFACE` import from the embedding test, which eliminates a compiler warning and cleans up the test code. The binary and build artifacts are updated as a result of the rebuild. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
A new GitHub Actions workflow is introduced to run tests and linting on every push and pull request, ensuring code quality and preventing regressions in the main branch. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Rebuilt the tinymemory-module crate and its dependencies, resulting in updated compiled binaries and debug information. The changes reflect a routine rebuild with no intentional modifications to source code or behaviour. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Introduce the initial specification document for the tinybus module, defining its interface, protocol, and expected behavior to guide implementation and future development. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
crates/tinymemory-module is its own workspace root, so it has its own target/ that the root-anchored /target/ rule never matched. The auto-commit hook picked up 3064 build files, including a 33 MB cdylib. Co-authored-by: Medulla <medulla@tinyhumans.ai>
Introduce a new `Module` variant to the `DriverClass` enum to represent loadable native modules that are reached over an in-process bus. This variant sits between `Embedded` and `External` because it is neither compiled into the host binary nor does it cross a process boundary, which changes how the host applies admission and egress policies. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
The conversion function now returns an empty result when given an empty input, preventing a panic that occurred when trying to process an empty slice. This ensures the adapter behaves correctly for edge cases where no data is provided. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
crates/tinymemory-module is its own workspace root, so it builds into its own target/ that the root-anchored /target/ ignore never matched. The .gitignore rule is already widened; this removes the 3064 files it should have covered. Co-authored-by: Medulla <medulla@tinyhumans.ai>
Add a complete release pipeline that builds, packages, and publishes native module bundles for Linux, macOS, and Windows across multiple architectures. The workflow resolves the release target from either an existing tag or the just-published crate version, then compiles the module for each platform in a matrix, assembles platform-specific archives with checksums, uploads them as workflow artifacts, and finally creates a GitHub release with all assets and a TinyBus-generated checksum manifest. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
…acts Add a workflow_dispatch input that allows re-running the release workflow for an already existing tag, skipping the crate publish step. Also expose the tag and next_version outputs from the version step so that downstream jobs can consume them when the workflow is triggered manually. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
|
Warning Review limit reached
Next review available in: 52 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughThis change adds a standalone TinyMemory TinyBus module. It defines configuration, host-side embeddings, service forwarding, wire error mappings, loader tests, CI execution, and native artifact release workflows. ChangesTinyMemory module integration
Estimated code review effort: 5 (Critical) | ~90 minutes Sequence Diagram(s)sequenceDiagram
participant Host as Host process
participant Broker as TinyBus broker
participant Module as TinyMemory module
participant Embedder as HostEmbedder
Host->>Broker: Serve and name host embedder
Host->>Module: Load native cdylib
Module->>Broker: Register memory service
Host->>Module: Invoke recall or store
Module->>Embedder: Request host embeddings
Embedder-->>Module: Return vectors
Module-->>Host: Return memory result
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
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. Comment |
Add a GitHub Actions workflow to automate the release process, enabling consistent and repeatable publishing of new versions. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
The release workflow was failing because it referenced an incorrect artifact path for the built binaries. Updated the path to match the actual output location of the build step, ensuring the release job can find and upload the artifacts successfully. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Updated the GitHub Actions release workflow to use the latest versions of checkout, setup-node, and other actions, ensuring compatibility with current runner environments and avoiding deprecation warnings. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
The release workflow has been updated to use the latest versions of GitHub Actions, ensuring compatibility with current runner environments and avoiding deprecation warnings. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
All four crates in the workspace now have `publish = false` set because the dependency graph includes `tinycortex-api`, which is consumed by path and not available on crates.io, making `cargo package` unable to resolve the graph. Since every consumer takes this repository by path or git, publishing is not intended. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
There was a problem hiding this comment.
Actionable comments posted: 11
🧹 Nitpick comments (4)
crates/tinymemory-module/src/config_test.rs (2)
136-154: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAssert the fields the round trip is most likely to break.
The fixture sets
ollama_base_urlandcloud_embedding_model, but the assertions skip both. The test also skipsmemory,embedding_routes, andstorage_provider, which are the nested fields that carry the real wire risk. A serde rename or a container-level attribute change on those fields would pass this test.♻️ Proposed additional assertions
assert_eq!(back.workspace_dir, config.workspace_dir); + assert_eq!(back.ollama_base_url, config.ollama_base_url); + assert_eq!(back.cloud_embedding_model, config.cloud_embedding_model); assert_eq!(back.cloud_embedding_dimensions, 8); assert_eq!(back.models_supporting_dimensions, vec!["m".to_string()]); assert_eq!(back.driver_id, "tinycortex");🤖 Prompt for 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. In `@crates/tinymemory-module/src/config_test.rs` around lines 136 - 154, Expand a_populated_config_round_trips assertions to verify ollama_base_url and cloud_embedding_model, plus the configured memory, embedding_routes, and storage_provider nested fields. Ensure the fixture populates those nested fields with representative non-default values so serde field renames or container attributes would be detected by the round-trip test.
72-88: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winScan nested JSON objects, not only top-level keys.
The loop inspects
object.keys()at depth one. The next test documents exactly why that is not enough:agentmemory_secretsits one level down. A recursive walk turns this test into the guard the comment claims it is, and it would catch a future credential field inMemoryConfigorStorageProviderConfigwithout another manual discovery.This is the test-side counterpart of the strip gap raised in
crates/tinymemory-module/src/config.rsLines 159-164.♻️ Proposed recursive key check
- for key in object.keys() { - let lowered = key.to_ascii_lowercase(); - for forbidden in [ - "api_key", - "apikey", - "token", - "secret", - "password", - "credential", - ] { - assert!( - !lowered.contains(forbidden), - "config field {key:?} looks like it carries a credential; \ - embeddings go over the bus precisely so it does not have to" - ); - } - } + fn assert_no_credential_keys(value: &serde_json::Value, path: &str) { + const FORBIDDEN: [&str; 6] = [ + "api_key", + "apikey", + "token", + "secret", + "password", + "credential", + ]; + match value { + serde_json::Value::Object(map) => { + for (key, nested) in map { + let lowered = key.to_ascii_lowercase(); + for forbidden in FORBIDDEN { + assert!( + !lowered.contains(forbidden), + "config field {path}.{key} looks like it carries a credential; \ + embeddings go over the bus precisely so it does not have to" + ); + } + assert_no_credential_keys(nested, &format!("{path}.{key}")); + } + } + serde_json::Value::Array(items) => { + for item in items { + assert_no_credential_keys(item, path); + } + } + _ => {} + } + } + + assert_no_credential_keys(&value, "config");Note: a recursive check will fail today, because
memory.agentmemory_secretserializes as a key even when it isNoneunless the field carriesskip_serializing_if. Confirm the serialized shape first, then either addskip_serializing_ifupstream or restrict the recursive assertion to keys with a non-null value.🤖 Prompt for 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. In `@crates/tinymemory-module/src/config_test.rs` around lines 72 - 88, Update the config credential-scan test around the current top-level key loop to recursively traverse nested JSON objects and inspect every key. Confirm the serialized representation first; if optional fields such as memory.agentmemory_secret appear with null values, either add the appropriate skip_serializing_if behavior or limit the assertion to keys with non-null values, while preserving the existing forbidden-key checks.crates/tinymemory-module/src/config.rs (1)
159-164: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick winReachability path
● Entry crates/tinymemory-module/src/lib.rs:101 setup: `MemoryConfig` travels verbatim, and it contains a bearer token field for a │ ▼ ● Sink crates/tinymemory-module/src/config.rsMake the credential-key test recursive.
strip_host_credentialsremoves the only credential-bearing field currently defined inMemoryConfig, andStorageProviderConfigcontains onlyprovider. Walk nested objects and arrays so future credential fields cannot bypass the structural guard.🤖 Prompt for 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. In `@crates/tinymemory-module/src/config.rs` around lines 159 - 164, The credential check in MemoryConfig::strip_host_credentials is not recursive. Update it to traverse nested objects and arrays, removing or detecting credential-bearing fields at every depth while preserving the existing boolean result. Extend the related coverage in crates/tinymemory-module/src/config_test.rs lines 72-88 to verify nested object and array cases; no other site changes are required.crates/tinymemory-module/src/embedding_test.rs (1)
199-203: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winThis assertion does not test the property named in the test.
The test is named
an_absent_host_fails_by_name_rather_than_hanging. The assertion at line 203 checks only that the error message is non-empty. Every error satisfies that, including one raised for an unrelated reason. The test would still pass if the failure came from a broken transport rather than from an unresolved bus name.Assert the text the provider produces for an unreachable host, so the test proves the operator receives an actionable message.
♻️ Proposed fix to assert the actual failure mode
let error = provider .embed(&["alpha"]) .await .expect_err("no embedder is served"); - assert!(!error.to_string().is_empty()); + let rendered = error.to_string(); + assert!( + rendered.contains("embedding host unreachable") || rendered.contains("host embed failed"), + "the error must name the absent host, got: {rendered}" + );🤖 Prompt for 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. In `@crates/tinymemory-module/src/embedding_test.rs` around lines 199 - 203, Update the assertion in the test using provider.embed so it verifies the exact actionable error text produced when the host is unreachable or the bus name cannot be resolved, rather than merely checking that the message is non-empty. Keep the existing expect_err flow and ensure the assertion distinguishes this intended failure mode from unrelated transport errors.
🤖 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 @.github/workflows/release.yml:
- Around line 14-20: Update the publish job condition to require both the
main-branch reference and an empty existing_tag input. Preserve normal releases
while preventing version bumps, tagging, and crate publication when
workflow_dispatch supplies an existing tag; ensure the corresponding release
flow uses the same gate if duplicated.
- Around line 291-311: Update the Windows package assembly step identified by
“Assemble Windows module package” to also copy docs/specs/tinybus-module.md into
the package, matching the Unix package contents. Adjust the modules.toml
generation using $moduleName, $hash, and Set-Content so it writes one line
without embedding an extra `n before Set-Content adds its line terminator.
In `@crates/tinymemory-module/src/embedding.rs`:
- Around line 275-286: Update the vector-width validation in the embedding
validation block to always require each vector’s length to equal
self.dimensions, including when dimensions is zero. Remove the conditional that
skips validation for zero dimensions, preserving the existing error for any
mismatched vector. Update the relevant FakeHostEmbedder test to return a
non-empty vector for a zero-width provider and assert validation fails.
In `@crates/tinymemory-module/src/lib.rs`:
- Around line 128-136: Update the error handling around
create_memory_with_local_ai so the returned setup_error contains only a
stage-level message and does not include the workspace path or underlying
factory error. Log the captured inner error locally before returning the
sanitized error, preserving the existing failure propagation through
setup_error.
- Around line 123-126: Protect the process-global embedding host initialization
in setup with a process-wide once-only guard, so multiple ModuleHost instances
cannot replace it. Update the setup flow around BusEmbeddingHost::new and
set_embedding_host to initialize only on the first call while preserving the
existing connection and config for that initialization.
In `@crates/tinymemory-module/tests/module_e2e.rs`:
- Around line 191-200: Update the capability assertions in the module end-to-end
test to require that the advertised set exactly matches Capability::MANDATORY,
rejecting every capability outside that set rather than checking only the
absence of Capability::Tree. Preserve the existing mandatory-capability
validation while adding the exact-set comparison.
- Around line 374-384: Update the ExportPage test around outcome so it uses an
input the service is guaranteed to reject instead of a zero limit, then require
the call to return an error and assert that the error’s wire_name starts with
"ai.tinyhumans.tinymemory.Error.". Preserve the contract-name validation while
removing the optional-success path.
- Around line 441-452: Update
the_declared_method_list_matches_the_served_interface to validate the actual
loaded manifest.methods rather than only routing constants. Use an isolated
loader test or reuse a shared method-name list from manifest construction, and
assert that every served method, including ImportRecords, is present in the
manifest admission surface.
- Around line 19-22: Update the documented loader-test command in the module_e2e
test instructions to build from the standalone tinymemory-module workspace and
load the resulting artifact from that workspace’s target directory, rather than
the root workspace and root target directory. Preserve the existing ignored
exact-test invocation.
In `@docs/specs/tinybus-module.md`:
- Around line 95-97: Update the List contract to prevent unbounded MemoryEntry
responses: add pagination or enforce a documented server-side result ceiling
with a named error, matching the existing ExportPage framing approach. Update
the List specification and add an end-to-end test that exceeds the selected
boundary and verifies the defined behavior.
- Line 31: Update the fenced timing-output code block in tinybus-module.md to
declare the text language by changing its opening fence to use text, while
preserving the block contents and closing fence.
---
Nitpick comments:
In `@crates/tinymemory-module/src/config_test.rs`:
- Around line 136-154: Expand a_populated_config_round_trips assertions to
verify ollama_base_url and cloud_embedding_model, plus the configured memory,
embedding_routes, and storage_provider nested fields. Ensure the fixture
populates those nested fields with representative non-default values so serde
field renames or container attributes would be detected by the round-trip test.
- Around line 72-88: Update the config credential-scan test around the current
top-level key loop to recursively traverse nested JSON objects and inspect every
key. Confirm the serialized representation first; if optional fields such as
memory.agentmemory_secret appear with null values, either add the appropriate
skip_serializing_if behavior or limit the assertion to keys with non-null
values, while preserving the existing forbidden-key checks.
In `@crates/tinymemory-module/src/config.rs`:
- Around line 159-164: The credential check in
MemoryConfig::strip_host_credentials is not recursive. Update it to traverse
nested objects and arrays, removing or detecting credential-bearing fields at
every depth while preserving the existing boolean result. Extend the related
coverage in crates/tinymemory-module/src/config_test.rs lines 72-88 to verify
nested object and array cases; no other site changes are required.
In `@crates/tinymemory-module/src/embedding_test.rs`:
- Around line 199-203: Update the assertion in the test using provider.embed so
it verifies the exact actionable error text produced when the host is
unreachable or the bus name cannot be resolved, rather than merely checking that
the message is non-empty. Keep the existing expect_err flow and ensure the
assertion distinguishes this intended failure mode from unrelated transport
errors.
🪄 Autofix
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 Plus
Run ID: 58d83ba6-3c79-4bd1-b18e-6ee4b2f56c9f
⛔ Files ignored due to path filters (1)
crates/tinymemory-module/Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (20)
.github/workflows/ci.yml.github/workflows/release.yml.gitignoreCargo.tomladapters/tinycortex/src/convert.rsapi/src/lib.rsapi/src/wire.rsapi/src/wire_tests.rscrates/tinymemory-module/Cargo.tomlcrates/tinymemory-module/src/config.rscrates/tinymemory-module/src/config_test.rscrates/tinymemory-module/src/embedding.rscrates/tinymemory-module/src/embedding_test.rscrates/tinymemory-module/src/lib.rscrates/tinymemory-module/src/service/mod.rscrates/tinymemory-module/src/service/test.rscrates/tinymemory-module/tests/module_e2e.rsdocs/specs/tinybus-module.mdsrc/registry/class.rsvendor/tinybus
Summary
Ports the memory engine out of the host binary and into a TinyBus module, the
same shape
tinydocsandtinywalletalready use: acdylibspeaking themodule ABI, admitted through the ABI/manifest/SHA-256 gates and attached to the
host's private in-process broker as an ordinary bus peer.
Two things are worth stating plainly up front, because the first one is the
reason a reader might expect a different justification:
profiles with
dep-sim.py: 0 third-party crates, 0 native builds.rusqlitehas five parents in the host, so moving one of them changes nothing.
cargo build --timingsputs the engine at ~14.7s of serial critical path (176s → ~161s, ≈8.4%), and
the architectural boundary survives compilation in a way a Cargo feature does
not.
Related issue
None.
API or behavior changes
Additive, no breaking changes.
tinymemory_api::wire— the error-name table, used by both ends so thenames cannot drift. One name per
MemoryErrorvariant rather than per outcomeclass: the host is itself a
MemoryProviderto callers above it, andget'scontract makes a miss
Ok(None)whileInvalidis a real failure, socollapsing variants is observable.
PathEscapemust never arrive asInvalid.An unrecognised name decodes to
Other, neverInvalid— telling a caller itsinput was wrong when it was not sends it into a rewrite loop.
DriverClass::Module. A host fact, never self-reported; each variant gatespolicy, and neither
EmbeddednorExternaldescribes an in-process peerreached over a bus.
tinymemory-module(crates/tinymemory-module), servingai.tinyhumans.tinymemory.Memoryat/ai/tinyhumans/tinymemory/Memorywith 12methods.
adapters/tinycortex: addedentry_to_tinycortexandnamespace_summary_to_tinycortex, exhaustively destructuring as the rest ofthat module does.
Validation
Commands actually run, with their outcome:
cargo fmt --all -- --check— cleancargo clippy --all-targets --all-features -- -D warnings— cleancargo build --all-targets --all-features— cleancargo test --all-features— greenPlus, for the module (its own workspace, so the root
--all-targetsneverreaches it — this is why CI grew a
modulejob):cargo fmt/clippy -D warnings/build/testunder--manifest-path crates/tinymemory-module/Cargo.toml— 22 lib tests greenTests
api/src/wire_tests.rs(7) — round-trips every variant, asserts every name isdistinct, and pins the three collapses that would be bugs: an unknown name is a
backend failure and not an input error, a path escape does not become
Invalid, a miss staysNotFound.crates/tinymemory-module/tests/module_e2e.rs(8) — a real broker, a realdlopen. Seven are#[ignore]d, and that is not lint-dodging:Broker::spawnbinds its tasks to the creating tokio runtime, so a second
#[tokio::test]inthe same process finds a broker whose tasks died with the first and hangs
until some deadline above it fires. Any test driving a real module has to be
alone in its process. CI runs them in a loop with
timeout 300.embedding seam.
The recall E2E asserts the host embedder's call count rather than result
ranking. Retrieval tuning is not what this port changes, and an assertion on
ranking would fail for reasons unrelated to the seam. Noted in the test.
Documentation
docs/specs/tinybus-module.md— the full spec, including the zero-shedfinding and the critical-path measurement, so the next reader does not redo
the analysis and reach the wrong conclusion from dep counts alone.
Two notes for reviewers, both deliberate:
resolve_api_keyreturnsNoneunconditionally and
ModuleConfig::strip_host_credentialsdropsagentmemory_secretbefore the config crosses the boundary, warning when itdoes. This was found while debugging: an earlier structural test only checked
top-level config keys and missed a nested secret.
worker_threads = 2,lazy = false. A recall that triggers an embed makesan outbound call from inside an inbound one, which deadlocks on a single
worker; and store bring-up opens a database and runs migrations, so deferring
it to first call would move that cost somewhere surprising.
crates/tinymemory-moduleis its own workspace root. A path dep into a nestedworkspace resolves
workspace.packageagainst the enclosing root, andexcludegoverns membership rather than inheritance resolution — so theinherited-field errors could not be fixed from the root manifest. There is a
comment on the
excludeentry explaining this.Checklist
#[allow(...)],#[ignore], or relaxed lints — seven#[ignore]sadded deliberately, for the runtime-affinity reason above; they are run by
CI one process at a time, not skipped
.envcontents in the diff or the descriptionSummary by CodeRabbit
New Features
Release Improvements
Documentation