dev-manager-tauri/docs/ai-context/project-brief.md
lanrtop c7333038c5
All checks were successful
Push & PR Check / check (push) Successful in 1m20s
Push & PR Check / check (pull_request) Successful in 58s
docs(resource/broker): 记录设计边界与逐卡验收证据
同步蓝图、契约映射和本机凭证迁移前备份约束;UI 与真实环境终验保持待办。

Rules-Applied: R01,R05,R07
2026-09-23 18:46:12 +09:00

46 lines
2.3 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 炼境 — 速查卡
**定位**:项目 Agent 化的本地控制面。炼境管理多个 Git 工作区,分发版本化基线、发现状态并汇总交付信号;项目本身仍拥有业务规则、测试、部署声明与交付决策。
## 技术栈
| 层 | 技术 |
|----|------|
| 前端 | React 19 + TypeScript + TailwindCSS + React Query + Zustand + React Flow |
| 后端 | Rust + Tauri v2 |
| 数据 | SQLite(rusqlite + r2d2) |
| MCP | 内嵌 HTTP Server(供 Codex、Claude 等客户端 adapter 调用) |
| 包管理 | pnpm |
## 关键约定(改代码前必看)
1. **Tauri command ↔ 前端封装**:新增 command 必须同步更新 `src/lib/commands.ts`
2. **DB 变更必须有 migration**:在 `src-tauri/src/db.rs` 的 `migrate()` 里补语句,否则旧版本升级报错
3. **Rust 业务函数依赖注入**:禁止内部 `pool().get()`,连接由调用方传入
4. **接入包模板 = 分发给被管理项目的规则**:改 `resources/onboarding/` 务必同步 `docs/templates/`
5. **项目身份上下文**:`.lian-jing/context.json` 是工具无关的 `project_id` 单一事实来源;`.claude/liangjing.json` 仅保留为 Claude 兼容投影;`.lian-jing/capability-packs.json` 记录托管基线版本,版本不符必须通过自检报告升级提示
## 目录速查
```
src/lib/commands.ts 前后端契约(唯一前端入口)
src-tauri/src/commands/ Rust 后端实现(一功能一文件)
src-tauri/src/db.rs 数据库 schema + migration
src-tauri/src/credential_store.rs Windows 本机凭证引用、校验与兼容迁移
src-tauri/src/mcp_server.rs MCP Server(agent 调用炼境的入口)
src-tauri/src/mcp_tools.rs MCP tool schema 与 dispatch
src-tauri/src/commands/delivery_status.rs 项目交付信号聚合(Git / Gitea / 部署证据)
src-tauri/resources/onboarding/ 接入包分发模板
.blueprint/ 项目蓝图
docs/ai-context/ AI 上下文文档(本文件、契约映射)
docs/templates/ 接入包模板草案(设计层)
```
## 验收命令
```bash
pnpm typecheck # TypeScript 类型检查
pnpm tauri dev # 启动开发环境
cargo test # Rust 单元测试(src-tauri/ 目录下运行)
```