Stop a durable-namespace drift, and shed a web framework (#18 §B2/§D2) - #43
Conversation
…i#18 §B2/§D2) Three findings, all in this crate, none touching another repo. §B2 -- the sync-state KV namespace was declared twice ----------------------------------------------------- `core/src/engine/sync.rs` held pub const HOST_SYNC_STATE_NAMESPACE: &str = "composio-sync-state"; while the engine holds `tinycortex::memory::sync::state::STATE_NAMESPACE` with the same literal. Host and engine therefore agreed only by coincidence of the string. Change either one and they read and write *different* KV namespaces, stranding every persisted Composio sync cursor -- with no error anywhere, because both sides are individually valid. Now a re-export, so they agree by construction. A test additionally pins the value, because the namespace is durable: changing it is a data migration, and that should fail loudly here rather than surface later as a sync that silently restarts from the beginning. §D2 -- `regex` was never used by this crate -------------------------------------------- The only apparent usage was a *local module* named `regex` (`pub mod regex { pub use crate::engine::backend::score::extract::regex::extract; }`), not the crate. No `use regex::`, no `Regex::new`, nothing. Honest classification: this is a redundant declaration, not a shed. `cargo tree -i regex` still reaches it through tinycortex; only core's false claim to need it is gone. §D2 -- `axum` was a test-only dependency in the normal graph ------------------------------------------------------------ All four references are inside `mod tests` (from line 726), where `store::factories`' tests stand up a throwaway HTTP server to exercise the embedder's failure paths. Declared as a normal dependency, it put a web framework into every build that links this crate. This one is a real shed, measured: tinymemory-tinycortex (default) 169 -> 154 tinymemory-tinycortex --features memory-git 173 -> 158 `cargo tree -p tinymemory-tinycortex -e normal -i axum` now reports no match at all. Checked and deliberately left alone: `rand` and `walkdir` are genuinely production (`new_summary_id`, `engine/persona.rs`). A first pass misread `rand` as test-only because an unrelated `#[cfg(test)]` sits above the `pub fn` that uses it. cargo fmt --all -- --check: clean cargo clippy --workspace --all-targets --all-features: clean cargo test --workspace: 1207 passed, 0 failed (core 798 -> 799) (cherry picked from commit 00006503f60bceda83df6d18d26fe7d6a7ccda8c)
|
Important Review available on request
Reviews should be triggered manually for repositories with fewer than 10 stars. Select Trigger review above or comment ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 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 flows0 changed behaviours across 9 relationships. 6 surrounding behaviours are shown (60 graph nodes walked). 46 further behaviours left out to keep the diagram readable. flowchart LR
n0["new"]:::impacted
n1["..._is_tolerated_and_skill_store_is_retained"]:::impacted
n2["composio_sync_document_reaches_memory_tree"]:::impacted
n3["...pe_item_is_skipped_for_memory_tree_ingest"]:::impacted
n4["config_less_adapter_skips_memory_tree_ingest"]:::impacted
n5["run_source_pipeline"]:::impacted
n1 -->|calls| n0
n1 -->|tests| n0
n2 -->|calls| n0
n2 -->|tests| n0
n3 -->|calls| n0
n3 -->|tests| n0
n4 -->|calls| n0
n4 -->|tests| n0
n5 -->|calls| n0
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. |
…e-drift-and-dep-hygiene # Conflicts: # core/Cargo.toml
Issue #18 §B2 and §D2. Three findings, all inside this crate, no submodule change and no companion PR in another repo.
§B2 — the sync-state KV namespace was declared twice
core/src/engine/sync.rsheld:while the engine holds
tinycortex::memory::sync::state::STATE_NAMESPACEwith the same literal.Host and engine therefore agreed only by coincidence of the string. Change either one and the two read and write different KV namespaces — stranding every persisted Composio sync cursor, with no error anywhere, because both sides remain individually valid. A duplicated literal is a drift hazard precisely when the thing it names is durable.
It is a re-export now, so they agree by construction. A test additionally pins the value, because changing the namespace is a data migration: it should fail loudly here rather than surface later as a sync that silently restarts from the beginning.
§D2 —
regexwas never used by this crateThe only apparent usage was a local module named
regex:Not the crate. No
use regex::, noRegex::new, nothing.Honest classification: this is a redundant declaration, not a shed.
cargo tree -i regexstill reaches it through tinycortex — itstinymemory-coreparent arm is simply gone. What is removed is core's false claim to need it, which is what §D2 is actually about ("reachable only through a feature").§D2 —
axumwas a test-only dependency in the normal graphAll four references are inside
mod tests(from line 726), wherestore::factories' tests stand up a throwaway HTTP server to exercise the embedder's failure paths. Declared as a normal dependency, it put a web framework into the graph of every build linking this crate.This one is a real shed, measured by the §D5 budget script:
tinymemory-tinycortex(default)tinymemory-tinycortex --features memory-gitcargo tree -p tinymemory-tinycortex -e normal -i axumnow reports no match at all — axum and its tower/hyper tree are gone.Checked and deliberately left alone
randandwalkdirare genuinely production —new_summary_idandengine/persona.rs. A first pass misreadrandas test-only because an unrelated#[cfg(test)]sits above thepub fnthat uses it; the fan-out measurement is not sufficient on its own, the enclosing item has to be checked.Validation
cargo fmt --all -- --checkcargo clippy --workspace --all-targets --all-featurescargo test --workspacescripts/ci/dependency-budget.shMerge order
Independent of #42 (§A3) — disjoint files, either can land first. The
vendor/gitlinks are byte-identical tomain.