Add a member for syncing one memory source, whatever kind it is - #104
Conversation
`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.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 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. Comment |
How this change flows1 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
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. |
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:
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 checknor 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
setupcallglobal::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.
NotFoundis not an empty syncAn unregistered id answers
NotFoundrather 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,METHODSwith its array length and the members count in the bus crate's docs, andEXPECTED_METHODSin the loader E2E.Validation
cargo check --workspace --all-targetsclean in both workspaces;cargo test --workspace2034 passing, module lane 70 passing, loader E2E green across the isolated cases; clippy-D warningsclean on root and module;cargo fmtclean on both;cargo doc --no-deps --all-featuresclean under-D warnings;engine-containment.shholds.