Skip to content

chore(memory): bump vendor/tinymemory to v1.6.0 and implement the new contract - #5773

Closed
M3gA-Mind wants to merge 2 commits into
tinyhumansai:mainfrom
M3gA-Mind:chore/bump-tinymemory-v1.6.0
Closed

M3gA-Mind wants to merge 2 commits into
tinyhumansai:mainfrom
M3gA-Mind:chore/bump-tinymemory-v1.6.0

Conversation

@M3gA-Mind

@M3gA-Mind M3gA-Mind commented Aug 25, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Bumps vendor/tinymemory d9a8a6ea (v1.3.0) → 1a6a24ae (v1.6.0) — 26 commits, three releases, 53 files.
  • Implements the five host trait impls the new contract requires. The bump and the host code are one commit because they cannot be split: the host cannot implement a trait method the pinned contract does not declare, so either half alone leaves main red.
  • Also advances vendor/tinycortex b7cf1213 → 84c994b7 — one commit, and a required companion rather than a second bump; see below.
  • The surface was larger than the two methods this work was scoped from: create_segment and append_turn each gained a parameter and ChunkQuery gained six fields. Details below.

Which commit this pins, and why not an earlier tag

Pinned: 1a6a24ae6d4733943bb23b3c71e80f5139025c61. The v1.6.0 tag is an annotated tag over that exact commit, so the tag and the sha are the same thing — but do not substitute an earlier tag:

tag contains tinymemory#91 contains #92
v1.4.0 ✗ ✗
v1.5.0 ✗ ✗
v1.6.0 (pinned) ✓ ✓

Both fixes merged at 07:34 on 2026-08-25, after v1.5.0 was cut. git compare reports each merge commit ahead of v1.4.0 and v1.5.0 and behind v1.6.0. A reviewer would reasonably assume any tag carries them; only this one does.

Problem

tinymemory v1.4.0 added two trait methods with no default bodies, so the pin could not move without host code:

async fn recall_namespace_recent(&self, namespace: &str, limit: usize)
    -> Result<Vec<NamespaceMemoryHit>, MemoryError>;
async fn insert_event(&self, event: &EpisodicEvent) -> Result<(), MemoryError>;

Solution

Five impls (not six — ModuleMemoryProvider carries 18 Memory* traits and MemoryEpisodic is not among them; Capability::Episodic is absent from ARTIFACT_CAPABILITIES, so as_episodic() never hands back the module driver).

GuardedRetrieval::recall_namespace_recent — carries_content: false, no redaction. The flag describes the payload the host sends, not the result it gets back; this call sends a namespace name and a count, so there is nothing to redact.

GuardedEpisodic::insert_event — modelled on tree.append, not on insert_turn beside it. insert_turn passes NO_NAMESPACE because an EpisodicTurn has none; an EpisodicEvent does, so it is admitted against event.namespace with carries_content: true and its content and subject redacted. The knock-on is included: create_segment's comment calling itself "the only episodic call that names a namespace" is no longer true and is updated here.

ModuleMemoryProvider::recall_namespace_recent — returns Unsupported naming the pinned artifact, and is the one method in that file that does not forward. Ok(vec![]) would be the tempting answer and is wrong: the contract says an empty vector from this method means the namespace is empty, so returning it because the binary cannot answer asserts something false no caller can distinguish — the over-claim shape of #5641/#5623 moved into a return value. A bare forward would come back as an untyped Other after a round trip (#5598). This introduces a new pattern in that file; every other method forwards unconditionally. It collapses to a module_call! on the next artifact re-pin.

The message is built from ARTIFACT_CAPABILITIES_PIN rather than a literal, so it cannot drift from the pin.

What rides along — 26 commits, and most of it is not ours

Ours (4): the Notion fetch_type fix at both call sites (tinymemory#92, 0fd40091 + 7b32ba95), the source-registry permissions fix (#91, 2409d867), and a docs follow-up (ab6736ad).

Everything else is #5560 contract work by other contributors, and some of it is behaviour, not plumbing:

PR What it changes
#90 recency-recall Adds recall_namespace_recent — the reason this bump needs host code
#95 contract-batch-v14 New insert_event member; per-session sequence threaded through the segment members (this is what changed create_segment/append_turn arity); chat attribution; mail headers on the bus
#99 close-every-gap "Give the host every read it still runs raw SQL for"; serves ComposioHost and ConfigLoader inside the module; advances the nested tinycortex
#100 module-periodic-sync-loops Runs the periodic memory sync loops inside the module

The last two deserve a reviewer's attention: the periodic memory sync loops and the Composio host seam move into the module. That is the same subsystem as the Notion sync fix riding along in this PR, and it is a placement change by another contributor, not a fix of ours.

The nested vendor/tinycortex advance inside tinymemory also carries tinycortex #144 (fetch_type) and #146 (render_properties, the openhuman#5500 fix) — the two commits that were stranded when the sync pipelines were ported out of tinycortex. Note they arrive in tinymemory's nested copy; openhuman's [patch] resolves tinycortex from its own vendor/tinycortex, so what actually executes is the top-level pin.

The tinycortex companion, and why it is not scope creep

cargo check fails on the tinymemory bump alone:

error[E0425]: cannot find function `count_chunks_matching` in module `crate::engine::backend::chunks`
error[E0432]: unresolved imports `...::ChunkDetailRow`, `...::SourceTotal`

tinymemory v1.6.0 calls those; tinycortex #157 adds them. tinymemory's own nested pin already points at 84c994b7, but openhuman's [patch] at Cargo.toml:1234 forces tinycortex to resolve from openhuman's vendor/tinycortex, which overrides it. So v1.6.0's requirement is only satisfied by moving openhuman's own pin. One commit, no choice about which.

Larger than the two-method summary

Worth stating plainly, because it was not in the scope this was planned from:

  • create_segment gained start_seq: Option<u32> and append_turn gained seq: Option<u32> (the per-session sequence from Skills runtime, onboarding, deep links, and core RPC refinements #95). Threaded through the guard and the recording provider as pass-throughs.
  • ChunkQuery gained six filter fields (entity_ids, entity_kinds, content_contains, and three more). Three call sites now use ..Default::default(), which defaults them to "no filter" and preserves each site's existing behaviour exactly. This PR deliberately opts into none of the new filtering.

Verification

  • cargo check --lib --tests — exit 0.
  • cargo fmt --all -- --check — exit 0.
  • cargo clippy -p openhuman --no-deps -- -D warnings — exit 0 (the CI-shaped lane).
  • Tests across every touched module: guard:: 145 passed · modules::memory:: 18 passed · memory::preferences:: 7 passed · memory::tree:: 98 passed · memory::tools:: 43 passed. 0 failed.

Three revert-checks, each observed:

  1. Drop redaction from insert_event → assertion left != right failed: the credential reached the driver verbatim — redact_outbound was not applied / left: "Authorization: Bearer abcdefghijklmnop".
  2. Unsupported → Ok(vec![]) in the module provider → the pinned artifact cannot serve this member: [].
  3. Refuse an untrusted external driver → both new guard methods assert driver.call_count() == 0, so a guard that decided after touching the driver fails.

One thing I could not pin, and a correction to the plan this was built from. The plan expected NO_NAMESPACE vs &event.namespace to be caught by "a namespace outside the policy's scope is refused". It is not: admit_write passes namespace only to guard_span (policy.rs:148), so the two allow and deny identically and differ solely in what the audit span records. I wrote a tracing-capture test that did catch it — reverting to NO_NAMESPACE gave left: Some("-") right: Some("team-notes") — but it proved flaky under parallel test execution (tracing caches callsite interest globally; rebuild_interest_cache() did not fix it), and a flaky test is worse than an admitted gap, so I removed it. The choice is therefore correct-by-construction for when admit_write gains real namespace scoping, and untested until then.

Impact

Memory subsystem. No RPC or UI surface changes. The Unsupported return is new observable behaviour for any caller of recall_namespace_recent on the module driver — by design, and preferable to the two silent alternatives.

Deliberately not in this PR, per standing decisions:

  • The cdylib artifact is not re-pinned. ARTIFACT_CAPABILITIES_PIN stays "1.3.0" and the registry keeps its tinymemory-module-1.3.0-* assets. This is why §3's Unsupported is needed at all; re-pinning is a separate decision.
  • The pre-existing carries_content inconsistency is not fixed. Two structurally alike pairs are labelled oppositely today — documents.query_documents sends a user query with true and redacts, while retrieval.recall_namespace_scored sends one with false and does not; tree.append writes content with true and redacts, while episodic.insert_turn writes user conversation with false and does not. Latent, because check_egress and redact_outbound are both no-ops off an External driver — and live the first time one binds. insert_event follows the tree.append side. Flagged for separate filing, not resolved here.

Related

  • Refs #5633 — the Notion fetch_type fix reaches openhuman with this bump. Can be hand-closed after merge; both call sites are fixed and shipped.
  • Refs #5635 — likewise can be hand-closed after merge.
  • Refs #5727 — cannot be closed by this PR. This bump is a live instance of it: ARTIFACT_CAPABILITIES is per-family, and this breaks inside one. Capability::Retrieval stays claimed and the_capability_list_matches_the_pinned_release still passes, while one member of that family is unserved and detectable only at call time. Every existing guard reports green while a real gap opens. #5500 was already closed as completed on 2026-08-24 (tinycortex fix(skills): persist OAuth credentials and fix skill auto-start lifecycle #146 plus backend OpenHuman is not available as a one-click cloud deployment #1281), so it needs nothing here — the tinycortex note above is about which copy executes, not about that issue's status.

… contract

The bump and the host code are one commit because they cannot be split: the
host cannot implement a trait method the pinned contract does not declare, so
either half alone leaves main red.

vendor/tinymemory d9a8a6ea (v1.3.0) -> 1a6a24ae (v1.6.0), 26 commits across
three releases. Carries our two fixes — the Notion fetch_type fix at both call
sites (tinyhumansai#92) and the source-registry permissions fix (tinyhumansai#91) — and a large amount
of tinyhumansai#5560 contract work by other contributors, listed in the PR body.

vendor/tinycortex b7cf1213 -> 84c994b7 is a required companion, not a second
bump: tinymemory v1.6.0 calls chunks::count_chunks_matching and friends, which
tinycortex tinyhumansai#157 adds, and openhuman's [patch] forces tinycortex to resolve from
its own vendor/ rather than tinymemory's nested pin. One commit.

Host changes the new contract requires:
- GuardedRetrieval::recall_namespace_recent — carries_content=false, no
  redaction: the flag describes the outbound payload, and this call sends a
  namespace and a count.
- GuardedEpisodic::insert_event — modelled on tree.append, not insert_turn:
  an EpisodicEvent carries a namespace and prose, so it is admitted against
  event.namespace with carries_content=true and its content and subject
  redacted.
- ModuleMemoryProvider::recall_namespace_recent — returns Unsupported naming
  the pinned artifact. Ok(vec![]) would assert a namespace is empty when the
  binary simply cannot answer, which no caller could tell apart.
- create_segment and append_turn gained an Option<u32> sequence parameter, and
  ChunkQuery gained six filter fields — neither is in the two-method summary
  this work was scoped from.
- The create_segment comment naming it the only namespaced episodic call is
  no longer true and is updated here.
@M3gA-Mind
M3gA-Mind requested a review from a team August 25, 2026 09:14

@tinysweeper tinysweeper 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.

tinysweeper found nothing blocking. Approving.

$0.0000 · 0 in / 0 out

@tinysweeper tinysweeper Bot added the priority: p3 Whenever. Cosmetic, a nicety, or a cleanup with no user visible effect. label Aug 25, 2026
@coderabbitai

coderabbitai Bot commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d6af3f56-2ce4-4e08-8dd3-afbcb1f50f62

📥 Commits

Reviewing files that changed from the base of the PR and between 1111bdf and 8f73346.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (11)
  • src/openhuman/memory/guard/families.rs
  • src/openhuman/memory/guard/families_tests.rs
  • src/openhuman/memory/guard/test_support.rs
  • src/openhuman/memory/preferences/tests.rs
  • src/openhuman/memory/tools/raw_store/raw_chunks.rs
  • src/openhuman/memory/tools/search/vector_search.rs
  • src/openhuman/memory/tree/tree/rpc.rs
  • src/openhuman/modules/memory.rs
  • src/openhuman/modules/memory_tests.rs
  • vendor/tinycortex
  • vendor/tinymemory

Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

The change adds guarded episodic event insertion and recent namespace recall. It adds sequence parameters to episodic operations, updates recording providers and tests, reports unsupported module capabilities with typed errors, applies default query fields, and updates vendor references.

Changes

Episodic memory APIs

Layer / File(s) Summary
Guarded episodic and retrieval methods
src/openhuman/memory/guard/families.rs
Adds namespace-scoped recent recall and event insertion. Event content and subject are redacted before forwarding. Episodic segment and turn methods accept optional sequence numbers.
Provider support and guard tests
src/openhuman/memory/guard/test_support.rs, src/openhuman/memory/guard/families_tests.rs, src/openhuman/memory/preferences/tests.rs
Updates recording and scripted providers for the new trait members. Tests cover admission, refusal, and redaction.
Pinned module capability handling
src/openhuman/modules/memory.rs, src/openhuman/modules/memory_tests.rs
Returns a typed unsupported error when the pinned artifact lacks recent namespace recall. Tests verify the capability details.
Default query initialization
src/openhuman/memory/tools/raw_store/raw_chunks.rs, src/openhuman/memory/tools/search/vector_search.rs, src/openhuman/memory/tree/tree/rpc.rs
Initializes unspecified query filters from default values.

Vendor pointer updates

Layer / File(s) Summary
Vendor commit references
vendor/tinycortex, vendor/tinymemory
Updates both vendor subproject commit references.

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

Merge Risk: ⚪ Minimal · up to 8f733

The PR updates the memory dependency contract and its host implementations, with reported checks and tests passing; no actionable merge-blocking risk remains beyond normal review.

Suggested reviewers: senamakel

Poem

A rabbit guards the memory door,
Redacting secrets before they soar.
Events gain numbers, turns align,
Recent recalls report the design.
Default filters rest in place,
New vendor pins complete the chase.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 28.13% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 32 functions across 9 files. (2 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 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.
Title check ✅ Passed The title clearly summarizes the main changes: updating vendor/tinymemory to v1.6.0 and implementing the required memory contract changes.
Full details: Docstring Coverage

Explanation

Docstring coverage is 28.13% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 32 functions across 9 files. (2 skipped: 2 unsupported.)

✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch

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.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8f73346bb7

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +1172 to +1173
let _ = (namespace, limit);
Err(MemoryError::unsupported_raw(format!(

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Honor the full-capability override before rejecting recent recall

When a developer loads the locally built v1.6 module with the documented OPENHUMAN_MEMORY_MODULE_ASSUME_FULL_CAPABILITIES=1 override, as_retrieval() advertises the full current contract, but this method still returns Unsupported without contacting that module. Consequently, the newly supported RecallNamespaceRecent member remains unusable and the advertised surface is internally inconsistent; return this pinned-artifact error only when the override is off, and forward the call when it is on.

Useful? React with 👍 / 👎.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Aug 25, 2026
The two Cargo worlds keep separate lockfiles and CI resolves both with
--locked. The root lock moved with the bump; app/src-tauri's did not, so
Rust Quality failed on 'cannot update the lock file ... because --locked was
passed'. One line: tinymemory 1.3.0 -> 1.6.0.
@M3gA-Mind

Copy link
Copy Markdown
Collaborator Author

Overlap with #5725, flagged rather than resolved. Raising it here so whoever reviews either PR sees the other; I have not touched #5725 and am not proposing which should win.

#5725 ("Route the recall, reset and flush paths through the contract", @YellowSnnowmann, currently CHANGES_REQUESTED) adds the same trait methods in the same files: guard/families.rs, guard/test_support.rs, preferences/tests.rs, modules/memory.rs, plus tree/retrieval/rpc.rs which this PR does not touch. Whichever lands second takes a conflict across all of them.

More than a conflict, the two disagree on the axis that was deliberately left open:

this PR (#5773) #5725
vendor/tinymemory + vendor/tinycortex gitlinks moved not moved — its body defers them to "Phase D"
ARTIFACT_CAPABILITIES_PIN left at 1.3.0 1.3.0 → 1.6.0
registry module assets left at tinymemory-module-1.3.0-* moved to 1.6.0-* (11 assets)
Capability::Episodic / impl MemoryEpisodic for ModuleMemoryProvider not added (five impls) added, with as_episodic wired
ModuleMemoryProvider::recall_namespace_recent local Unsupported naming the pin module_call! forward

That last row follows from the one above it, and both readings are internally consistent. This PR was scoped not to re-pin the artifact, which is exactly why it cannot forward: with the pinned binary at 1.3.0 there is no RecallNamespaceRecent member to call. #5725 re-pins to 1.6.0, at which point forwarding is correct and this PR's Unsupported branch is dead on arrival — the outcome the plan behind this work predicted for that case.

Two facts that may help whoever decides:

  • tinymemory v1.6.0 does have 11 published module artifacts, so the re-pin Route the recall, reset and flush paths through the contract #5725 makes is available, not aspirational.
  • The gitlinks are not optional for either PR. Route the recall, reset and flush paths through the contract #5725 adds host impls for methods the pinned contract does not declare, which does not compile — error[E0407]: method 'recall_namespace_recent' is not a member of trait 'MemoryRetrieval', plus EpisodicEvent not existing at v1.3.0 at all. I verified that with the compiler before opening this PR; it is why the bump and the impls are one commit here. Its own body reaches the same conclusion about the dual gitlink ("Both gitlinks move in Phase D or neither does").

So the two are closer to halves of one change than to competing versions of it: this PR carries the gitlinks #5725 needs, and #5725 carries the artifact re-pin that makes this PR's Unsupported unnecessary. Sequencing them is a maintainer call, not one I should make from here.

@M3gA-Mind

Copy link
Copy Markdown
Collaborator Author

Closing in favour of #5725 — the maintainer has chosen that approach for the memory-contract work.

No criticism of either; they overlap on the same trait methods in the same files (guard/families.rs, guard/test_support.rs, preferences/tests.rs, modules/memory.rs) and only one can land. #5725 is the broader piece and it makes the artifact-pin decision this PR deliberately reserved.

Three findings from this PR that #5725 should not have to rediscover — recorded here and on #5725:

  1. Neither v1.4.0 nor v1.5.0 contains tinymemory#91 or [Feature] Design REPL / interactive shell for openhuman binary (skills & flow testing) #92. Both merged at 07:34 on 2026-08-25, after v1.5.0 was cut; both compare as ahead of those tags. The first tag that contains them is v1.6.0, an annotated tag over 1a6a24ae6. Any future gitlink move that targets v1.4.0 or v1.5.0 will silently fail to carry the config-permissions and Notion fetch_type fixes.
  2. Two Cargo worlds, both resolved with --locked. A gitlink move needs app/src-tauri/Cargo.lock regenerated as well as the root one, or PR CI Gate fails on the second world. (Route the recall, reset and flush paths through the contract #5725 already touches both, so this is confirmation rather than a warning.)
  3. The bump and the host impls cannot be split. The host cannot implement a method the pinned trait does not declare — verified by compiler probe at the current pin:
    error[E0407]: method recall_namespace_recent is not a member of trait MemoryRetrieval, and EpisodicEvent does not exist there at all. Whichever PR moves the gitlink must carry the impls in the same commit, or main goes red either way.

Consequence worth stating plainly: #5725 does not move any vendor/ path, so openhuman#5633 and #5635 remain blocked after it merges — their fixes are in tinymemory main but not in this repo until a separate bump lands.

Design notes and the per-impl policy reasoning are preserved in TRAIT-IMPL-PLAN.md.

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

Labels

priority: p3 Whenever. Cosmetic, a nicety, or a cleanup with no user visible effect.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant