chore(core): remove zero-reference deps and redirect_links domain - #5052
Conversation
…main
Remove dependencies and a domain that have zero references in the tree
(compile time, binary size, and supply-chain surface for no benefit).
Dependencies (root Cargo.toml), each verified with `cargo tree -i`:
- Real sheds (nothing else pulls them): postgres, prometheus, dialoguer,
shellexpand, clap_complete, opentelemetry{,_sdk,-otlp}.
- Redundant direct declarations (the crate stays in-tree transitively via
ethers-signers / tinychannels / tinyjuice / pdf-extract; only the direct
declaration is dropped): ripemd, prost, mail-parser, async-imap,
unicode-{segmentation,width,normalization}.
- 4 tree-sitter optional decls that no feature activates (tinyjuice owns
its own grammars; tokenjuice-treesitter behaviour is unchanged).
Domain:
- redirect_links (RPC-registered but never wired into the message
pipeline): drop the module plus its controller registration, namespace
description, security-policy internal-dir entry, and test-inventory
allowlist entry.
npm:
- @rive-app/react-canvas (root; the app uses @rive-app/react-webgl2),
remotion, @remotion/player, @remotion/zod-types (app). Lockfile pruned.
webview_accounts is intentionally NOT removed: contrary to the issue's
claim, the core module is a live cross-crate API (WechatScanPayload,
list_ingest_payload, ...) consumed by app/src-tauri/src/wechat_scanner,
so deleting it breaks the desktop build. memory_archivist is likewise
kept: its 44 LOC hold real Config->MemoryConfig adapter logic, so
inlining would duplicate that across call sites.
Verified: core default, core --no-default-features, and Tauri shell
cargo check; frontend tsc; and the test-inventory guard all pass.
Closes tinyhumansai#5051
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughUnused Rust and npm dependencies are removed, with ChangesDependency and domain cleanup
Memory diff registration
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related PRs
Suggested labels: Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 694290747e
ℹ️ 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".
The redirect_links domain is removed in this PR, but an upgraded profile can still hold a legacy `workspace_dir/redirect_links/links.db` (stored URL history) written by an older version. Dropping the directory from WORKSPACE_INTERNAL_DIRS made `is_workspace_internal_path` stop classifying that leftover SQLite store as internal state, so an agent with workspace access could read or overwrite it. Keep the directory on the internal denylist — it costs one string and preserves defense-in-depth for pre-removal data. Addresses the Codex review note on tinyhumansai#5052.
Resolve alongside dead-dep removal; Cargo.lock + app/src-tauri/Cargo.lock resynced (cargo metadata --locked passes), pnpm-lock unchanged. mail-parser/async-imap remain via vendored tinychannels (redundant-decl removal).
Scope notes for the two pre-merge check warningsBoth are advisory (CodeRabbit's review itself approved). Documenting the decisions here. 1. "Out of Scope Changes: 2. "Linked Issues:
Delivered here: dead Rust crates, dead |
Resolve Cargo.lock conflict by taking main's lock and re-resolving against the merged Cargo.toml (cargo metadata --locked passes for root + app/src-tauri). Dead-dep removals intact.
…sai#5084) tinyhumansai#5051 removed unicode-width as zero-reference, but main's tui chat renderer (src/openhuman/tui/render.rs, tinyhumansai#5084) now imports unicode_width::UnicodeWidthStr, so removing it breaks the default-feature build (E0432 / clippy -D warnings). Re-add it as an optional dep gated under the `tui` feature, matching how ratatui/crossterm are gated.
CodeGhost21
left a comment
There was a problem hiding this comment.
Review — clean, well-justified removal-only PR ✅
I independently verified the "zero reference" claims against the PR head (pull/5052/head) rather than trusting the description — they hold up.
Verification performed (PR head)
redirect_linksremoval is complete — no leftover references anywhere except the intentionalWORKSPACE_INTERNAL_DIRSdenylist entry, which is correctly retained with a clear comment (protects a legacyredirect_links/links.dbfrom agent read/write after an upgrade). Good security instinct.- Dropped crates have zero first-party
use— grepped every removed crate (unicode_normalization,unicode_segmentation,ripemd,mail_parser,async_imap,prost,postgres,shellexpand,prometheus,dialoguer,clap_complete,opentelemetry,tree_sitter) acrosssrc/,tests/,src/bin/,benches/→ 0 uses. Since Rustuserequires a direct dependency (transitive availability doesn't enter the extern prelude), this is the check that actually gates the build, and it's clean. unicode-widthgating is correct — its only consumer issrc/openhuman/tui/render.rs:14,177,194(UnicodeWidthStr), which lives behind thetuifeature.tuiis in the default feature set, so the defaultcargo checkgenuinely exercised this path. No non-tui code needs it.tree-sitterdrop is safe —tokenjuice-treesitter = ["tinyjuice/tinyjuice-treesitter"]forwards only to the submodule (which owns its own grammars); nothing referenceddep:tree-sitter.- npm —
remotion*and@rive-app/react-canvashave zero imports inapp/src. - Invariant preserved —
schemas.len() == controllers.len()still holds (both derive from one registry); the removednamespace_description("redirect_links")test assertion is the only test touched.
Minor notes (non-blocking)
- PR-body framing mismatch (docs only): the body lists
unicode-widthunder "Redundant direct declarations (only the direct decl is dropped)." That's inaccurate — it wasn't dropped, it was retained and converted tooptional+tui-gated becausetui/render.rsis its sole direct consumer. The code change is correct (and strictly better); only the description is misleading. CodeRabbit's "adjusting tui Unicode support" is the accurate characterization. Worth a one-line correction so future archaeologists aren't confused. - The old
unicode-normalizationCargo.tomlcomment claimed use bymemory_conversations::tokenize, but there are 0 direct uses on the PR head — that comment was already stale, so dropping it is fine.
Risk assessment
Very low. Pure deletion, no behavior change; redirect_links.* RPC methods were never wired into the message pipeline or the frontend, so their removal is invisible to users. The two intentional deviations from the linked issue — keeping the webview_accounts core domain (real cross-crate consumer in wechat_scanner) and not inlining memory_archivist (holds a real config adapter) — are correctly reasoned.
Nice, disciplined cleanup — looks safe to merge.
Reconcile dep-gating with main (now incl. tinyhumansai#5052/tinyhumansai#5060/tinyhumansai#5061/tinyhumansai#5062): - Cargo.toml: union gating (optional axum/sentry/ppt-rs + http-server/ inference/documents/crash-reporting features) with main's tower + tui deps and desktop-automation/tui features; default = union of both feature sets. - app/src-tauri: shell forwards crash-reporting/http-server/desktop-automation (feature-forwarding gate passes; tui allowlisted). - all_tests.rs: union of http-server + desktop-automation gate tests. - types.rs: keep main's redirect_links security denylist entry (tinyhumansai#5052). Cargo.lock + app/src-tauri/Cargo.lock resynced (--locked passes); cargo fmt, feature-forwarding gate, and clippy -D warnings all clean locally.
Summary
Cargo.tomlcrates, 4 unusedtree-sitteroptional decls, 4 dead npm packages, and the unwiredredirect_linksdomain. Pure removal, no behaviour change.webview_accountscore domain (its premise is factually wrong) andmemory_archivist.Problem
Dead dependencies and domains cost compile time, binary size, supply-chain surface, and reader confusion for no benefit. Everything removed here has zero references in the tree, verified by grep over
src/+app/src-tauri/src/and bycargo tree -i <crate>(grep alone is not sufficient — several of these stay in-tree transitively). Resolves #5051.Solution
Root
Cargo.tomldependencies — each classified bycargo tree -i:Cargo.lockwith their exclusive transitives):postgres,prometheus,dialoguer,shellexpand,clap_complete,opentelemetry/opentelemetry_sdk/opentelemetry-otlp.ethers-signers/tinychannels/tinyjuice/pdf-extract, so only the direct decl is dropped — no shed, just no longer an unstable direct surface):ripemd,prost,mail-parser,async-imap,unicode-segmentation,unicode-width,unicode-normalization.tree-sitteroptional decls (tree-sitter,-rust,-typescript,-python) that no feature activates —tokenjuice-treesitterforwards only totinyjuice/tinyjuice-treesitter, andtinyjuiceowns its own grammars. AST compression is unchanged.redirect_linksdomain (RPC-registered but never wired into the message pipeline — the promised inbound/outbound link-rewrite integration was never hooked up): removed the module and all references — controller registration (all.rs), namespace description (all.rs), theWORKSPACE_INTERNAL_DIRSsecurity entry (security/policy/types.rs), and theDOMAIN_ALLOWLISTentry inscripts/generate-test-inventory.mjs. Theschemas.len() == controllers.len()invariant still holds (both derive from oneregistry()), and the stalenamespace_description("redirect_links")assertion inall_tests.rswas removed with it.npm —
@rive-app/react-canvas(root; the app renders via@rive-app/react-webgl2, 6 files), andremotion/@remotion/player/@remotion/zod-types(app; zero imports).pnpm-lock.yamlpruned (0added /63removed; the standaloneapp/pnpm-lock.yamlnever contained them).Intentional deviations from the issue
webview_accountscore domain NOT deleted. The issue's "only references are themod.rsdeclaration and a doc-comment" finding was scoped toopenhuman_coreand missed the cross-crate consumer:app/src-tauri/src/wechat_scanner/{mod,dom_snapshot}.rsimportsopenhuman_core::openhuman::webview_accounts::{WechatScanPayload, list_ingest_payload, validate_scan, ...}(defined inwebview_accounts/wechat_ingest.rs).wechat_scanneris wired unconditionally (lib.rs), so deleting the module breaks the desktop build —cargo check --manifest-path app/src-tauri/Cargo.tomlfails without it. Suggest striking that acceptance criterion (or narrowing it to "confirm not RPC-registered", already true).memory_archivistNOT inlined. Its 44 LOC are not a pure re-export — they hold a realConfig→MemoryConfigadapter (engine_config). Inlining would duplicate that across its call sites (a DRY regression) for no gain.Submission Checklist
redirect_linksremoval drops its own stale test assertion; the survivingschemas == controllersinvariant remains covered byall_tests.rs.docs/TEST-COVERAGE-MATRIX.md.redirect_linkswas RPC-only with no UI.Closes #5051below.Impact
postgres/tokio-postgres, theopentelemetrystack,prometheus,dialoguer/console-fuzzy,clap_complete,shellexpandand their exclusive transitives leaveCargo.lock(both root andapp/src-tauri). No version drift (0 new package stanzas).redirect_links.*methods are gone. They were never called by the pipeline or the frontend, so no user-visible change.GGML_NATIVE=OFF cargo check(default),GGML_NATIVE=OFF cargo check --no-default-features --features tokenjuice-treesitter,cargo check --manifest-path app/src-tauri/Cargo.toml,pnpm typecheck, andnode scripts/generate-test-inventory.mjsall pass.Related
#5048(inference gate),#5049(desktop-automation gate),#5050(lazy tool/config construction) — sibling contributors to the#5046embedded RAM budget.AI Authored PR Metadata (required for Codex/Linear PRs)
Summary by CodeRabbit
memory_diffnamespace with controller registration and updated CLI help text.redirect_linksnamespace from known listings/public API.redirect_linksas protected legacy state.tuiUnicode support.