Skip to content

Stop a durable-namespace drift, and shed a web framework (#18 §B2/§D2) - #43

Merged
YellowSnnowmann merged 2 commits into
tinyhumansai:mainfrom
YellowSnnowmann:feat/18-b2d2-namespace-drift-and-dep-hygiene
Aug 18, 2026
Merged

Stop a durable-namespace drift, and shed a web framework (#18 §B2/§D2)#43
YellowSnnowmann merged 2 commits into
tinyhumansai:mainfrom
YellowSnnowmann:feat/18-b2d2-namespace-drift-and-dep-hygiene

Conversation

@YellowSnnowmann

Copy link
Copy Markdown
Contributor

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

This is the hazard that caused §B2 to be reverted earlier in this issue's work. It was blocked on the extraction landing; #41 unblocked it.

§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 — its tinymemory-core parent 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 — 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 the graph of every build linking this crate.

This one is a real shed, measured by the §D5 budget script:

configuration before after
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 — axum and its tower/hyper tree are gone.

Checked and deliberately left alone

rand and walkdir are genuinely production — new_summary_id and engine/persona.rs. A first pass misread rand as test-only because an unrelated #[cfg(test)] sits above the pub fn that uses it; the fan-out measurement is not sufficient on its own, the enclosing item has to be checked.

Validation

Command Result
cargo fmt --all -- --check clean
cargo clippy --workspace --all-targets --all-features clean
cargo test --workspace 1207 passed, 0 failed (core 798 → 799)
scripts/ci/dependency-budget.sh 154 / 158, see table above

Merge order

Independent of #42 (§A3) — disjoint files, either can land first. The vendor/ gitlinks are byte-identical to main.

…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)
@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown

Important

Review available on request

  • 🔍 Trigger review

Reviews should be triggered manually for repositories with fewer than 10 stars. Select Trigger review above or comment @coderabbitai review to review the latest changes. For a full review, comment @coderabbitai full review.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: aa8e266f-9b11-4372-a902-d40151267daf


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 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 · 250 embedded · openrouter/openai/text-embedding-3-small

@tinysweeper

tinysweeper Bot commented Aug 18, 2026

Copy link
Copy Markdown

How this change flows

0 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
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 added the priority: p3 Whenever. Cosmetic, a nicety, or a cleanup with no user visible effect. label Aug 18, 2026
…e-drift-and-dep-hygiene

# Conflicts:
#	core/Cargo.toml
@YellowSnnowmann
YellowSnnowmann merged commit 6961bab into tinyhumansai:main Aug 18, 2026
13 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