Skip to content

docs: module rustdoc + ADR-004/005 + i18n dead_code clarification#18

Merged
juice094 merged 7 commits into
mainfrom
docs/module-rustdoc-adr
May 11, 2026
Merged

docs: module rustdoc + ADR-004/005 + i18n dead_code clarification#18
juice094 merged 7 commits into
mainfrom
docs/module-rustdoc-adr

Conversation

@juice094
Copy link
Copy Markdown
Owner

Summary

代码质量基线提升:为核心模块补充 rustdoc,创建 ADR 记录关键架构决策,澄清 i18n dead_code 标注。

Changes

  • 模块文档 ():
    • — 说明 与 feature-gate 的关系
    • — 索引引擎职责与入口点
    • — 工作流引擎概述
    • — 注册表层职责
    • — StorageBackend + AppContext 设计
    • — 守护进程职责
    • — re-export 说明与 feature gate
  • ADR:
    • ADR-004: MCP Tool Layer Trait Decoupling
    • ADR-005: AppContext Clone for Async Context Propagation
    • ADR 索引更新(ADR-003/004/005)

Verification

  • / / ✅
  • 427 tests all pass ✅

juice094 added 7 commits May 11, 2026 20:46
- 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
@juice094 juice094 merged commit 930628a into main May 11, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant