Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 97 additions & 0 deletions .github/release-draft-v0.20.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
## devbase v0.20.0 — 知识完备性

**主题**:从"能存"到"好用",消除知识库能力缺口。

---

### ✨ 新功能

#### Vault 双向链接图遍历(Sprint E/F 延伸)
- **`devkit_vault_graph`** 支持 BFS 双向遍历:`note_id` + `depth`(1–3)参数
- DB-first 构建:从 SQLite `outgoing_links` 出发,自动补全 incoming 边
- 知识图谱不再只是静态导出,而是可查询的图结构

#### Vault Git-based 历史追踪(Sprint E)
- **`devkit_vault_history`**(第 67 个 tool):基于 `git2` revwalk 的笔记变更追踪
- 支持 blob 内容比对,返回行级 `insertions` / `deletions`
- `VaultClient` trait 扩展:`get_vault_history()` 统一接口

#### 混合检索质量监控(Sprint F)
- **`devkit_search_quality`**(第 68 个 tool):返回 `HybridSearchMetrics`
- `latency_ms` — 查询耗时
- `keyword_recall` / `vector_recall` — 各路召回数
- `rrf_overlap` — keyword & vector 重叠项
- `keyword_source` — `"tantivy"` 或 `"sqlite_fallback"`
- `rrf_k` — 融合常数

#### Block 引用支持(Sprint G)
- `WikiLink.anchor`:支持 `[[note#heading]]` 与 `[[note#^block-id]]`
- `VaultNote.block_refs`:块级引用持久化(JSON metadata,无 schema 迁移)
- Vault 导出时自动检测 broken block refs(heading 锚点不存在时报告)

#### 性能回归基线(Sprint C)
- 新增 `#[ignore]` 性能回归测试:
- 1k 文档 keyword search `< 200ms`
- 10k 文档 keyword search `< 500ms`
- **ADR-003**:Redis 缓存评估完成 → **决策放弃引入**,现有 SQLite + Tantivy 栈已足够

---

### 🏛️ 架构原则

#### Client-Agnostic Principle(客户端无关原则)
- 核心能力零硬编码客户端路径(移除 `.clarity` 硬编码、泛化 `skill sync` 接口)
- 适配层(`scripts/claude/`)与核心代码严格分离
- 删除 Kimi/Claude 后,devbase 的编排、注册、索引、搜索、同步能力完全独立

---

### 📊 统计

| 指标 | v0.18.0 | v0.20.0 | 变化 |
|:---|:---:|:---:|:---:|
| MCP Tools | 64 | **68** | +4 |
| Tests | 437 | **451** | +14 |
| Workspace Crates | 18 | **19** | +1 |
| Schema | 34 | 34 | 稳定 |

---

### 🛠️ 修复与优化

- **Clippy 清零**:生产代码 `field-reassign-with-default` 修复
- **Rustfmt**:8 文件格式统一
- **Tantivy 健康评分**:`devkit_index_health`(Beta)持续可用
- **SQLite WAL**:默认启用,并发安全

---

### ⚠️ 已知限制

- `tree-sitter` grammar 编译成本仍维持 15–20s(已 feature-gate,可选关闭)
- Vault 历史依赖用户将 `vault/` 目录初始化为 Git 仓库
- Block 引用中的 `^block-id` 锚点目前仅解析,不验证存在性

---

### 📦 安装

```powershell
# Windows
irm https://raw.githubusercontent.com/juice094/devbase/main/scripts/install.ps1 | iex

# 或下载预编译二进制
wget https://github.com/juice094/devbase/releases/download/v0.20.0/devbase-v0.20.0-x86_64-pc-windows-msvc.exe -O devbase.exe
```

```bash
# Linux
wget https://github.com/juice094/devbase/releases/download/v0.20.0/devbase-v0.20.0-x86_64-unknown-linux-gnu -O devbase
chmod +x devbase
```

---

### 🙏 致谢

本版本全部功能由单人维护完成,遵循 **Client-Agnostic Principle** 与 **Local-First** 架构红线。
19 changes: 15 additions & 4 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,12 +212,21 @@ done

**Fitness Function**:
```bash
# 生产代码 unwrap 计数必须为 0
grep -rn "unwrap()\|expect()\|panic!(" src/ \
| grep -v "#\[cfg(test)\]" | grep -v "mod tests" | grep -v "tests/"
# 生产代码 unwrap 计数(排除 #[cfg(test)] 块及 tests.rs 文件)
for f in $(find src -name "*.rs"); do
test_line=$(grep -n "#\[cfg(test)\]" "$f" | head -1 | cut -d: -f1)
if echo "$f" | grep -qE "tests?\.rs$|_test\.rs$|/tests/"; then continue; fi
if [ -n "$test_line" ]; then
head -n "$((test_line - 1))" "$f" | grep -n "\.unwrap()"
else
grep -n "\.unwrap()" "$f"
fi
done
# 预期输出:空
```

**状态**:🟢 **已完成**(v0.20.1 复核:生产代码 unwrap = 0;此前 1090 为测试模块误统计)。

### 架构治理框架(Architecture Governance)

> 参考:外部架构治理方法论(Kimi 会话 `e9f2965f-b949-46a5-9d7c-afd6d4d9232c`)
Expand All @@ -244,7 +253,9 @@ grep -rn "unwrap()\|expect()\|panic!(" src/ \

| 债项 | 严重 | 当前值 | 目标阈值 | 清理路径 | 引入 Wave |
|---|---|---|---|---|---|
| `main.rs` 上帝文件 | 🟢 | 548 行 | ≤1000 行 | 拆分为 `commands/simple.rs` + `commands/skill.rs` + `commands/workflow.rs` + `commands/limit.rs`;全部 22 个命令/子命令树已迁移 | ≤15 |
| `main.rs` 上帝文件 | 🟢 | 778 行 | ≤1000 行 | 拆分为 `commands/simple.rs` + `commands/skill.rs` + `commands/workflow.rs` + `commands/limit.rs`;全部 22 个命令/子命令树已迁移 | ≤15 |
| Workspace crate 版本号混乱 | 🟡 | 6 个 crate 仍为 `0.1.0-alpha.1`,workspace 版本 `0.17.0-dev` 滞后主包 `0.20.0` | 全部统一为 `version.workspace = true` 或 `0.20.0` | 批量修正 `Cargo.toml` | v0.20.1 |
| RF-7 高耦合模块超标 | 🟡 | `registry.rs` (20)、`scan.rs` (18)、`digest.rs` (17) 超过 15 阈值 | ≤15 | `scan.rs` 拆分为 `scan/discover.rs` + `scan/filter.rs`;`digest.rs` 提取独立模块 | 持续 |
| `init_db()` 全局路径 | 🟢 | `AppContext` 已集成到全部 commands/ 模块;`main()` 通过 `AppContext` 分发配置;`init_db()` 无外部调用 | 0 | 已完成:`StorageBackend` trait + `AppContext` 全面替代;`db_path`/`workspace_dir`/`index_path`/`backup_dir` 已统一 | ≤15 |
| Tantivy+SQLite 双写一致性 | 🟡 | 无事务协调;**已添加反向检测**(`repair_tantivy_consistency` 现在检测 SQLite→Tantivy 缺失) | 补偿机制 | 长期:事务协调或 SQLite FTS5 替代;短期:反向检测 + 日志已落地(`fe14c81`) | 7 |
| 主从表切换 | 🟢 | Phase 1 全部完成:`repos` 表已删除,entities 为唯一数据源 | `entities` 为第一公民 | Phase 2 类型系统开放(新增 entity_type 无需改表结构) | v0.12.0 |
Expand Down
40 changes: 20 additions & 20 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ members = ["crates/*"]
resolver = "2"

[workspace.package]
version = "0.17.0-dev"
version = "0.20.0"
authors = ["juice094 <160722440+juice094@users.noreply.github.com>"]
edition = "2024"
license = "AGPL-3.0-or-later"
Expand Down
2 changes: 1 addition & 1 deletion crates/devbase-core-types/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "devbase-core-types"
version = "0.1.0-alpha.1"
version.workspace = true
edition = "2024"
description = "Core knowledge graph types: Node, Edge, NodeType"
authors = ["juice094 <160722440+juice094@users.noreply.github.com>"]
Expand Down
2 changes: 1 addition & 1 deletion crates/devbase-symbol-links/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "devbase-symbol-links"
version = "0.1.0-alpha.1"
version.workspace = true
edition = "2024"
description = "Code symbol link generator: similar-signature and co-located relationship discovery"
authors = ["juice094 <160722440+juice094@users.noreply.github.com>"]
Expand Down
2 changes: 1 addition & 1 deletion crates/devbase-sync-protocol/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "devbase-sync-protocol"
version = "0.1.0-alpha.1"
version.workspace = true
edition = "2024"
description = "Lightweight directory sync protocol with version vectors"
authors = ["juice094 <160722440+juice094@users.noreply.github.com>"]
Expand Down
2 changes: 1 addition & 1 deletion crates/devbase-syncthing-client/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "devbase-syncthing-client"
version = "0.1.0-alpha.1"
version.workspace = true
edition = "2024"
description = "Syncthing REST API client for folder management"
authors = ["juice094 <160722440+juice094@users.noreply.github.com>"]
Expand Down
2 changes: 1 addition & 1 deletion crates/devbase-vault-frontmatter/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "devbase-vault-frontmatter"
version = "0.1.0-alpha.1"
version.workspace = true
edition = "2024"
description = "Markdown frontmatter parser for vault notes"
authors = ["juice094 <160722440+juice094@users.noreply.github.com>"]
Expand Down
2 changes: 1 addition & 1 deletion crates/devbase-vault-wikilink/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "devbase-vault-wikilink"
version = "0.1.0-alpha.1"
version.workspace = true
edition = "2024"
description = "WikiLink parser and resolver for Markdown vaults"
authors = ["juice094 <160722440+juice094@users.noreply.github.com>"]
Expand Down
Loading
Loading