Skip to content

Add a member for syncing one memory source, whatever kind it is - #104

Merged
YellowSnnowmann merged 1 commit into
tinyhumansai:mainfrom
YellowSnnowmann:feat/5560-run-source-sync
Aug 25, 2026
Merged

Add a member for syncing one memory source, whatever kind it is#104
YellowSnnowmann merged 1 commit into
tinyhumansai:mainfrom
YellowSnnowmann:feat/5560-run-source-sync

Conversation

@YellowSnnowmann

Copy link
Copy Markdown
Contributor

The last contract gap for openhuman#5560.

The gap

MemorySourceSync::run_connection_sync(toolkit, connection_id) is Composio-shaped. A folder, repository, RSS feed or web page has neither a toolkit nor a connection id, so a host with a "sync now" button for those had no member to call and kept them on the engine.

That matters more than it sounds, because the engine function behind them is:

pub async fn run_source_pipeline(source, config) -> … {
    if source.kind == SourceKind::Composio {}

    let memory = crate::global::client_if_ready()
        .ok_or_else(|| … "memory client is not ready")?;   // ← folder / repo / rss / web
}

Both branches read the process-global memory client. A host that stops booting an in-process engine therefore loses source sync for every kind, and loses it quietly — the failure surfaces inside a spawned task that logs rather than propagates, so neither cargo check nor a green suite catches it. It took adding a diagnostic to a failing OpenHuman test to see it at all.

Inside the module the slot is filled (#100 made setup call global::bind), so routing through the driver is what makes this work.

A source id, not a source

The driver already reads the source registry — it must, because the per-source budgets the pipeline applies live there. Passing the whole entry would put a second copy of those caps on the wire and invite the two to disagree about limits that cost real money when they are wrong.

NotFound is not an empty sync

An unregistered id answers NotFound rather than a successful run that moved nothing. A caller retrying a source deleted underneath it should learn that; the two are indistinguishable if both report zero records.

Registration

All four places, in declaration order, so the drift assertion holds: the #[tinybus::interface] impl, the module manifest, METHODS with its array length and the members count in the bus crate's docs, and EXPECTED_METHODS in the loader E2E.

Validation

cargo check --workspace --all-targets clean in both workspaces; cargo test --workspace 2034 passing, module lane 70 passing, loader E2E green across the isolated cases; clippy -D warnings clean on root and module; cargo fmt clean on both; cargo doc --no-deps --all-features clean under -D warnings; engine-containment.sh holds.

`MemorySourceSync` could run a Composio connection and nothing else. A host with
a folder, repository, RSS or web-page source and a "sync now" button had no
member to call, so those paths stayed on the engine — and the engine function
behind them opens with `global::client_if_ready()`.

That made this the last thing standing between OpenHuman and deleting its
in-process engine. Without the member, a host that stops booting one loses
source sync for EVERY kind, and loses it quietly: the failure is "memory client
is not ready", raised inside a spawned task that logs rather than propagates, so
neither a compile nor a green test suite sees it.

## A source id, not a source

The driver already reads the source registry — it has to, because the per-source
budgets the pipeline applies live there. Passing the whole entry would put a
second copy of those caps on the wire and invite the two to disagree about
limits that cost money when they are wrong.

## NotFound is not an empty sync

An unregistered id answers `NotFound` rather than a successful run that moved
nothing. A caller retrying a source that was deleted underneath it should learn
that, and the two are indistinguishable if both report zero records.

Registered in all four places in declaration order, so the drift assertion holds:
the interface impl, the module manifest, `METHODS` with its length and the
members count in the bus crate's docs, and `EXPECTED_METHODS` in the loader E2E.
@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 4602e149-f587-419c-a65a-4e4d4427c2dc

Warning

Your free Security trial is over. An organization admin can activate billing to continue.


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.

@tinysweeper

tinysweeper Bot commented Aug 25, 2026

Copy link
Copy Markdown

How this change flows

1 changed behaviour across 4 relationships. 6 surrounding behaviours are shown (60 graph nodes walked). 31 further behaviours left out to keep the diagram readable.

flowchart LR
  n0["TinycortexProvider<br/>changed"]:::changed
  n1["assert"]:::impacted
  n2["EngineRuntimeConfig"]:::impacted
  n3["ModuleConfig"]:::impacted
  n4["setup"]:::impacted
  n5["people_and_profile_round_trip"]:::impacted
  n6["...ariants_round_trip_and_degrade_gracefully"]:::impacted
  n0 -->|uses| n2
  n4 -->|uses| n3
  n5 -->|calls| n1
  n6 -->|calls| n1
  classDef changed fill:#0d4429,stroke:#238636,color:#e6edf3
  classDef impacted fill:#161b22,stroke:#6e7681,color:#c9d1d9
  classDef flagged fill:#5a1e02,stroke:#d93f0b,color:#ffffff
  classDef blocking fill:#67060c,stroke:#f85149,color:#ffffff
Loading

Green: changed behaviour. Grey: surrounding behaviour. Arrows name the call, use, implementation, or test relationship. Orange: has findings. Red: has a finding that blocks the merge.

tinysweeper 0.1.0

@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
@YellowSnnowmann
YellowSnnowmann merged commit 3c5b000 into tinyhumansai:main Aug 25, 2026
27 checks passed
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