fix(build): restore dropped #[cfg(test)] re-exports so the Rust libtest target compiles#4749
fix(build): restore dropped #[cfg(test)] re-exports so the Rust libtest target compiles#4749oxoxDev wants to merge 1 commit into
Conversation
…compiles The orchestration merge (tinyhumansai#4720/tinyhumansai#4722/tinyhumansai#4725) restructured several domains into sub-modules but dropped the `#[cfg(test)]` re-export / import blocks that their `#[path] mod tests` (and inline `mod tests`) resolve against via `use super::*` / `super::`. This broke the whole Rust libtest target (main CI Lite red) and, because the coverage job compiles libtest, every open PR's coverage gate. The referenced symbols still exist — they only moved into the new sub-modules. This restores the test-facing re-exports/imports (no product change, no tests deleted or ignored): - channels/providers/web/mod.rs: WebChatParams, compose_system_prompt_suffix, locale_reply_directive, normalize_model_override, provider_role_for_model_override, required_string, optional_{string,bool,f64,u64}, json_output, inference_budget_exceeded_user_message, is_inference_budget_exceeded_error - config/schema/load/mod.rs: EnvLookup, ACTION_DIR_ENV_VAR, MEMORY_SYNC_INTERVAL_SECS_ENV_VAR - config/schemas/mod.rs: schemas - inference/local/service/ollama_admin/mod.rs: interrupted_pull_settle_window_secs - inference/provider/reliable.rs: StreamError - mcp_server/tools/mod.rs: list_tools_result_for_config - memory/chat.rs: DEFAULT_CLOUD_LLM_MODEL - memory/schema/mod.rs: NAMESPACE - memory/tree_source/file.rs: TreeKind, TreeStatus - sandbox/docker.rs: DockerOverrides
|
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 selected for processing (10)
📝 WalkthroughWalkthroughThis PR adds cfg(test) or cfg(any(test, debug_assertions))-gated re-exports and imports across ten Rust files (web channels, config schemas, inference, mcp_server, memory, sandbox) to restore symbol visibility for test submodules after module splits, plus one permanent public re-export and a formatting-only change. ChangesTest visibility restoration
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related PRs
Suggested labels: Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Comment |
|
Superseded by #4759 (merged 2026-07-09, @M3gA-Mind), which restores the same 10 test modules' imports. Closing as duplicate — main's libtest target is fixed there. Thanks @M3gA-Mind. |
Summary
#[cfg(test)]test-facing re-exports/imports that the orchestration module split (Feat/orch fixes #4720 / feat(orchestration): chat rework, Agent graph, global Kanban, presence #4722 / feat(orchestration): thin hosted-brain client — pushers, effect/tool executors, wire allowlist #4725) dropped across 10 modules, so the Rust libtest target compiles again.main's libtest target currently fails with 37 compile errors, socargo-llvm-cov(therust-core-coveragejob) cannot run for any PR.main's CI Lite has been red for several consecutive commits.Problem
#4720 / #4722 / #4725 restructured 10 modules into sub-modules but dropped the
#[cfg(test)]re-export/import blocks that each module's test submodule (#[path] mod testsor inlinemod tests, resolving viause super::*/super::…) depends on. The result is 37cargo test --libcompile errors — e.g. inchannels/providers/web:Because the libtest target compiles as one unit before test filtering, this blocks the
rust-core-coveragejob — and therefore the ≥80% diff-coverage merge gate — for all PRs, not just ones touching these modules.cargo check --lib(the product build) is unaffected; the breakage is test-only, which is why it slipped past the push checks (CI Full, which runs the full suite, only gates PRs targetingrelease).Solution
For each of the 10 modules, restore the missing test-facing re-exports/imports in the module root, pointing at the sub-module that now defines the symbol. Every re-export is gated (
#[cfg(test)], or#[cfg(any(test, debug_assertions))]+#[allow(unused_imports)]where a sibling uses that pattern) so nothing widens the non-test build or trips-D warnings.channels/providers/web/mod.rsWebChatParams;compose_system_prompt_suffix,locale_reply_directive,normalize_model_override,provider_role_for_model_override;required_string,optional_string,optional_bool,optional_f64,optional_u64,json_output;inference_budget_exceeded_user_message,is_inference_budget_exceeded_errorweb/types.rs,web/session.rs,web/schemas.rs,web/web_errors.rsconfig/schema/load/mod.rsEnvLookup;ACTION_DIR_ENV_VAR,MEMORY_SYNC_INTERVAL_SECS_ENV_VARload/env.rs,load/dirs.rsconfig/schemas/mod.rsschemas(fn)config/schemas/schema_defs.rsinference/local/service/ollama_admin/mod.rsinterrupted_pull_settle_window_secsollama_admin/util.rsinference/provider/reliable.rsStreamErrorinference/provider/traits.rsmcp_server/tools/mod.rslist_tools_result_for_configmcp_server/tools/specs.rsmemory/chat.rsDEFAULT_CLOUD_LLM_MODELconfig(storage_memory)memory/schema/mod.rsNAMESPACEmemory/schema/definitions.rsmemory/tree_source/file.rsTreeKind,TreeStatusmemory_store/trees/types.rssandbox/docker.rsDockerOverridessandbox/types.rsNo visibility changes were needed — every symbol was already
pub/pub(crate).Submission Checklist
N/A: restores compilation of existing tests; no behaviour change. The 37-error libtest target now compiles; the previously-broken web tests run (93 passed) and all restored modules' tests link again.N/A: changed lines are#[cfg(test)]re-export statements (no executable product lines to cover). This PR is what makes the coverage job runnable again for everyone.N/A: build fix, no feature change## Related—N/AN/A: test-only re-exportsCloses #NNN—N/A: no tracking issue; fixes the main-branch libtest regression from #4720/#4722/#4725Impact
cargo test --lib --no-rungoes from 37 errors → clean (Finishedin ~4m); unblocksrust-core-coverage/ the coverage gate for every open PR.#[cfg(test)]-gated re-exports; release builds are byte-identical.Validation
cargo test --lib --no-run→ compiles clean, 0 errors (was 37)cargo check --lib→ clean ·cargo fmt --check→ clean ·cargo clippy --lib→ no new warningsRelated
mainlibtest regression introduced by Feat/orch fixes #4720 / feat(orchestration): chat rework, Agent graph, global Kanban, presence #4722 / feat(orchestration): thin hosted-brain client — pushers, effect/tool executors, wire allowlist #4725 (module→sub-module split dropped#[cfg(test)]re-export blocks).Summary by CodeRabbit
New Features
Bug Fixes