From 773f78a64967922dba48be64358132ef74afcd41 Mon Sep 17 00:00:00 2001 From: lanrtop Date: Mon, 29 Jun 2026 18:02:57 +0900 Subject: [PATCH] =?UTF-8?q?docs(blueprint):=20agent-infrastructure=20?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E6=8B=86=E8=A7=A3=E4=B8=BA=205=20=E5=BC=A0?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E5=8D=A1=EF=BC=88planned=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit /architect + 复查自洽完成,拆出 A-E 五张 S/M 卡: 框架扫描 → 三件套生成 → 腐化评分 → 确认UI → 看板指示器 --- .blueprint/manifest.yaml | 4 +- .blueprint/modules/agent-infrastructure.md | 44 +++++++++++++++------- 2 files changed, 32 insertions(+), 16 deletions(-) diff --git a/.blueprint/manifest.yaml b/.blueprint/manifest.yaml index f254b75..5dfa0b9 100644 --- a/.blueprint/manifest.yaml +++ b/.blueprint/manifest.yaml @@ -6,7 +6,7 @@ description: > 成为每个项目的贴身导师。炼境本身亦被纳入其中, 形成可自我进化的开发智能闭环。 iteration: 1 -updated: 2026-06-29 +updated: 2026-06-30 @@ -381,7 +381,7 @@ modules: - id: agent-infrastructure name: Agent 友好基础设施生成 area: backend - status: concept + status: planned progress: 0 position: [3750, 0] diff --git a/.blueprint/modules/agent-infrastructure.md b/.blueprint/modules/agent-infrastructure.md index ef12ffd..d8d7308 100644 --- a/.blueprint/modules/agent-infrastructure.md +++ b/.blueprint/modules/agent-infrastructure.md @@ -83,22 +83,38 @@ ## 任务卡 -> 本模块为 L 级,需先走 /architect 设计再拆分。以下为 concept 阶段的方向记录。 +> /architect 已完成(2026-06-29),复查自洽后拆为以下 5 张可执行卡。 +> 执行顺序:A 和 C 可并行 → B(依赖 A)→ D(依赖 A+B)→ E(依赖 C) -### 💭 技术栈扫描与确认 UI -- status: concept +### 📋 A. 框架层扫描 + 契约路径推断 +- status: todo +- complexity: M +- files: src-tauri/src/commands/agent_infra.rs, src-tauri/src/commands/mod.rs, src-tauri/src/lib.rs, src/lib/commands.ts +- acceptance: `scan_agent_infra_stack(project_path, project_id)` 能从 package.json(serde_json 解析 deps)和 Cargo.toml(字符串匹配)识别 Drizzle/Prisma/Hono/Axum 等框架,返回带 confidence 的 DetectedContract 列表;有单元测试覆盖 drizzle/prisma/hono 识别 -### 💭 project-context.yaml 生成器 -- status: concept +### 📋 B. 三件套文件生成 +- status: todo +- complexity: M +- depends: A +- files: src-tauri/src/commands/agent_infra.rs, src/lib/commands.ts +- acceptance: `generate_agent_infra_files(project_path, project_id, contracts)` 正确写入 `docs/ai-context/project-context.yaml`(含实际契约路径)、向 AGENTS.md 注入元规则段落(已有则跳过)、生成含项目特定 globs 的 `.claude/rules/doc-freshness.md`;对同一项目重复执行幂等 -### 💭 AGENTS.md 元规则段落注入 -- status: concept +### 📋 C. 文档腐化评分 +- status: todo +- complexity: M +- files: src-tauri/src/commands/agent_infra.rs, src-tauri/src/db.rs, src/lib/commands.ts +- acceptance: `scan_doc_freshness(project_path, project_id)` 用 `silent_cmd("git").current_dir(project_path)` 读取契约路径 vs `docs/ai-context/project-context.yaml` 的最后 commit 时间戳,project-context.yaml 不存在直接返回 RED;结果写入 `doc_freshness_cache` 表(migration 补齐);前端封装就绪 -### 💭 .claude/rules/ 派生生成 -- status: concept +### 📋 D. 栈确认 UI + 生成按钮 +- status: todo +- complexity: M +- depends: A, B +- files: src/components/dashboard/AgentInfraPanel.tsx, src/components/dashboard/BlueprintModal.tsx +- acceptance: BlueprintModal 新增"Agent 基础设施"区块,展示 A 返回的检测结果(可编辑 contract 路径)、"生成三件套"按钮调用 B、展示写入结果(written/skipped/failed);UI 无类型错误 -### 💭 腐化风险看板(文档新鲜度评分) -- status: concept - -### 💭 技术栈变更感知与重新生成提示 -- status: concept +### 📋 E. 看板腐化指示器 +- status: todo +- complexity: S +- depends: C +- files: src/components/dashboard/ProjectCard.tsx, src/lib/commands.ts +- acceptance: ProjectCard 右上角显示腐化评分小圆点(🟢🟡🔴),读取 `doc_freshness_cache` 缓存(无缓存则不显示);不发起新的 git 扫描(仅读缓存)