Link tinymemory-bus and add the TinyMemory module client seam - #5647
Link tinymemory-bus and add the TinyMemory module client seam#5647senamakel wants to merge 6 commits into
Conversation
Add the tinymemory git submodule and register its tinymemory-bus crate as a path dependency in Cargo.toml. This provides the wire vocabulary for the TinyMemory TinyBus module, allowing the host to link only the payload types and member names without pulling in the engine, storage, or async runtime. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
The module file for the memory driver was missing from the repository, causing compilation failures. This change restores the file to its expected state, ensuring the driver module can be properly built and used. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Add a doc comment for the newly exposed `module` submodule, explaining that it communicates with TinyMemory over TinyBus rather than through the in-process tinycortex engine. The note clarifies that the two drivers are not yet interchangeable because they implement different API contracts, and that convergence will happen once TinyCortex re-exports the tinymemory-api. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
The Cargo.lock file is updated to include the new tinymemory-bus crate at version 0.1.0, which is now a dependency of the project. This change ensures the lock file reflects the addition of this crate and its dependencies to the workspace. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Reformatted the inline `matches!` macro calls in the driver error round-trip test to use multi-line layout, improving code readability without changing any test logic or behavior. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Updated the tinymemory submodule to the v1.1.0 release commit and documented in Cargo.toml that the submodule is pinned to this release tag rather than a main branch commit. This ensures the vendored crate matches the same version used to publish the per-platform module archives and their checksum.toml, guaranteeing that the library the host links against is the one those archives were built from. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (6)
Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe PR vendors the TinyMemory bus contract and adds a public ChangesTinyMemory module driver
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: 🔵 Low · up to The PR adds the TinyMemory client boundary and pins the dependency to the intended release. It is mergeable with explicit owner awareness that the repository’s signing or provenance policy for the vendored dependency still needs confirmation. Sequence Diagram(s)sequenceDiagram
participant Client
participant MemoryModule
participant TinyBus
participant TinyMemoryModule
Client->>MemoryModule: invoke typed operation
MemoryModule->>TinyBus: call member with serialized arguments
TinyBus->>TinyMemoryModule: deliver TinyBus request
TinyMemoryModule-->>TinyBus: return wire response
TinyBus-->>MemoryModule: return response
MemoryModule-->>Client: deserialize typed result
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1⚔️ Resolve merge conflicts 💡
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 |
What changed and why
TinyMemory ships as a loadable TinyBus module — a
cdylibexporting one objectwith 89 members on it. The host can load that binary but cannot
useanythingout of it, so the member names, the payload types and the error-name table have
to arrive as an ordinary library. They now do.
vendor/tinymemorysubmodule, pinned at thev1.1.0tag — the releasethat introduced
tinymemory-bus. Pinned at a tag rather than a main commitbecause a TinyMemory release is also what publishes the per-platform module
archives and their
checksum.toml; the library the host links has to be theone those archives were built from.
tinymemory-bus = { path = "vendor/tinymemory/crates/tinymemory-bus" }. Thisis the only piece of TinyMemory the host links: no engine, no storage, no
traits, no async runtime. Seven pure-Rust dependencies (
serde,serde_json,chrono,sha2,uuid,anyhow,thiserror).src/openhuman/memory/driver/module/— the client seam.The client seam
MemoryModulebinds the module's object over atinybus::Proxy.MemoryModule::callis public and reaches every member: pass a name fromtinymemory_bus::names::methodsand the positional arguments as a tuple. Typedwrappers cover the driver-level members (
DriverId,Capabilities,Health,Shutdown,OpenStore) and the mandatory core family (Store,Get,Forget,List,Namespaces) — what a host needs to bind a driver and proveit answers. The remaining families are one
calleach and get wrappers as thedriver seam grows into them.
OpenStorereturns an object path, not a value — a sibling store under thesame workspace exporting the identical interface — so
MemoryModule::atbindsone.
OBJECT_PATHis the root object, not the only one.The error mapping is the part worth reviewing
A TinyBus failure is a name plus prose.
MethodFailedis the one that reachedthe driver, and
tinymemory_bus::wire::from_wiremaps it back — the same tablethe module mapped out through, which is what stops the two ends drifting into
disagreeing about what a name means. The case that matters is
PathEscape: itreports a symlink or traversal that left the workspace sandbox, and flattening
it into
Invalidwould turn a security-relevant refusal into a caller mistake.Everything that is not a
MethodFailednever reached the driver, so it isreported as the transport fact it is rather than flattened into
Other:TimeoutMemoryError::TimeoutNameHasNoOwner,Transport,IoUnreachableUnknownMethod/Object/Interface,IncompatibleVersionBackendInvalidOtherInvalidwould send a caller into a rewrite loop over correct inputPublic API / behavior changes
Additive only. Nothing existing is touched: the diff is 7 files, and the only
edit to pre-existing code is
memory/driver/mod.rsgainingpub mod module;and a doc paragraph.
moduleis not aMemoryProviderimpl and is not wired into driverselection. It cannot be yet, and the module docs say so:
embeddedimplementsthe
tinycortex_apicontract this build pins, whilemodulespeaks thetinymemory-busvocabulary the loadable module was built against. At thecurrent TinyCortex pin those are unrelated types. They converge when the
TinyCortex pin moves to a revision that re-exports
tinymemory-api.Deliberately no
[patch]entry yetThe natural companion would be:
It is not here, and that is deliberate rather than forgotten. The vendored
TinyCortex pin (
ce98837) still defines the memory contract itself intinycortex-api; only newer revisions re-exporttinymemory-apiand pull it inby git. Adding the patch now would make cargo warn about a patch matching
nothing in the graph.
It has to land in the same change that bumps the TinyCortex pin. Without it the
git copy and this path copy resolve as two distinct crates and
MemoryEntryfrom one is not
MemoryEntryfrom the other — the exact failure TinyMemory'sown root manifest documents and patches around. The comment above the dependency
in
Cargo.tomlsays this so the next person to move the pin finds it.Validation
cargo build --lib— passcargo test --lib memory::driver::module— pass, 6 new testscargo fmt -- --check— passcargo clippy --lib --all-features— pass, no findingscargo clippy --all-targetsfails to compiletests/subconscious_fullstack_e2e.rs(
awaitin the non-asyncfn harness_with). Pre-existing and unrelated —the file is byte-identical to
main(diff <(git show main:...) ...is empty)and nothing in this PR can affect it. Not fixed here; raising rather than
widening scope.
Related
Depends on tinyhumansai/tinymemory#74, merged and released as
v1.1.0.Summary by CodeRabbit
New Features
Bug Fixes
Tests