test(knowledge_engine): 补齐 index.rs 与 index_state.rs 单元测试#20
Merged
Conversation
- Extend RegistryClient with save_relation, query_relations, delete_relations, list_vault_notes - Add WorkflowClient trait (list_workflows, get_workflow, run_workflow, get_execution) - Add VaultClient trait (list_vault_notes, read_vault_note, get_backlinks, build_vault_graph) - Implement all traits on AppContext (registry.rs, workflow/mod.rs, vault/mod.rs) - Enable AppContext Clone via Arc<Mutex<EnvVersionCache>> for spawn_blocking safety - Refactor relations.rs, workflow.rs, vault.rs to use trait calls exclusively - Eliminate all production-code inline crate:: calls in mcp/tools/ relations|workflow|vault
…inate loop-level I/O - index_repo: accept Config by parameter instead of loading internally - daemon.rs: load Config once before indexing loop - run_index_with_progress: hoist Config::load() out of repo loop - Extract prepare_repos() pure helper for path resolution / auto-registration - Result: ~20 fewer inline crate:: calls, eliminated repeated disk I/O in hot loop
…xing - Extract index_repo_core() with explicit writer/schema parameters - index_repo() retains legacy behavior (creates standalone writer) - Add index_repo_with_writer() for batch callers - daemon.rs: init writer once before loop, commit once after loop - Eliminates N-1 redundant Tantivy init/get_writer/commit cycles
- Add rustdoc to 7 core modules: i18n, knowledge_engine, workflow, registry, storage, daemon, embedding - Clarify rationale in i18n/mod.rs - Create ADR-004: MCP Tool Layer Trait Decoupling - Create ADR-005: AppContext Clone for Async Context Propagation - Update ADR index with ADR-003/004/005
- CONTRIBUTING.md: update health metrics to v0.15.0 / 427 tests / AGPL-3.0+ - SECURITY.md: update supported version to 0.15.x - Create CODE_OF_CONDUCT.md (Contributor Covenant v2.0) - Create SUPPORT.md (docs, issues, discussions, commercial support) - Create .github/PULL_REQUEST_TEMPLATE.md with checklist - Create .github/ISSUE_TEMPLATE/bug_report.md - Create .github/ISSUE_TEMPLATE/feature_request.md - Create .github/ISSUE_TEMPLATE/config.yml (disable blank issues)
- 修复 SCHEMA_DDL 缺失 repo_index_state 表(测试基础设施) - 将 registry/test_helpers 可见性调整为 pub(跨模块测试共享) - index.rs: 覆盖 prepare_repos (4 场景) + save_repo_index_state (1 场景) - index_state.rs: 覆盖 get_repo_index_state (4 状态测试) 及行为方法测试 - 修复 Windows 短文件名路径断言兼容性 - 新增 coverage_report.txt 到 .gitignore
69eb364 to
63293c1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
变更概要
SCHEMA_DDL缺失repo_index_state表(测试基础设施补齐)registry/test_helpers可见性为pub,供跨模块测试复用index.rs: 新增prepare_repos4 场景测试 +save_repo_index_state1 场景测试index_state.rs: 新增get_repo_index_state4 状态测试(Missing/Fresh/Stale/Unknown)及行为方法测试检查项
cargo test --all-targets全绿(437 passed / 0 failed)cargo clippy --all-targets -- -D warnings零警告cargo fmt --check通过