重构: 拆context.rs核心库(strategy自底向上·纯函数抽离)

- 新建 df-ai/context_helpers.rs(195行): 纯函数/类型/常量(TokenEstimator/ContextConfig/MessageGroup/TrackedMessage/classify_group/EvictionUnit/PROTECT_COUNT/TOOL_MISSING_PREFIX)
- context.rs 1332→1178行: 保留ContextManager struct+impl, pub use重导出(外部agentic.rs/mod.rs路径不变)
- lib.rs: pub mod context_helpers
Rust impl块约束: ContextManager方法未动一个字符, 纯函数搬迁零行为变更
主代兜底: cargo check --workspace 0 + test df-ai 119 + grep抽离项/pub use印证
strategy: 自底向上核心库优先, 单批1-2文件原子操作
This commit is contained in:
2026-06-19 03:31:50 +08:00
parent f1aa7ac33d
commit 63fe0a6375
3 changed files with 209 additions and 167 deletions

View File

@@ -3,6 +3,7 @@
pub mod ai_tools;
pub mod anthropic_compat;
pub mod context;
pub mod context_helpers;
pub mod coordinator;
pub mod model_fetch;
pub mod model_probe;