3 Bootstrap
shaotao edited this page 2026-06-12 18:42:19 +08:00
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.

Bootstrap 自举

Bootstrap 是毕织的"自我认知"模块——用毕织自己的能力来分析毕织自己、评审毕织自己、最终修改毕织自己。

Bootstrap 是整个项目第一个用到自己的模块。它不依赖外部框架,而是用 bixiweave 的 Pipeline + Agent 运行时来驱动自己。

动机

传统开发中人对代码库的理解文档和实际代码之间存在持续偏差。Bootstrap 通过 AI Agent 多轮扫描 + LLM 深度分析 + 三轮同行评审,自动维持文档与代码的同步,并发现系统深层缺陷。

核心流程

                    ┌──────────────┐
   设计文档 ──────→ │  Scanner    │ ─→ 差距报告
                    │  Agent      │     (doc_only / code_only)
   实际代码 ──────→ │             │
                    └──────────────┘
                           │
                           ▼
                    ┌──────────────┐
                    │  Marker     │ ─→ 模块标签
                    │  Agent      │     (core / auxiliary / deprecated)
                    └──────────────┘
                           │
                           ▼
                    ┌──────────────┐
                    │  Aligner    │ ─→ 对齐计划
                    │  Agent      │     (P0/P1/P2 优先级)
                    └──────────────┘
                           │
                    ┌──────▼──────┐
                    │  动手填差距  │  ← 阶段 A 目标
                    └─────────────┘

元评审Meta Review是独立的辅助能力

Architect ─┐ Safety Auditor ┼─ 三轮审计 → 共识报告 Ecosystem Obs. ─┘


## 运行方式

### 推荐:统一 CLI 入口

```bash
# 列出所有可用的 Flow
bixiweave bootstrap list

# 跑 Doc-Code Aligner扫描差距 → 打标签 → 出计划)
bixiweave bootstrap align

# 跑三轮元评审Pipeline 模式)
bixiweave bootstrap review

# 跑三轮元评审Event 模式 — Agent 自驱三轮,推荐)
bixiweave bootstrap review --event

# 查看上次运行结果摘要
bixiweave bootstrap status

底层 CLI自定义路径

python3 -m bixiweave.cli run <pipeline.json> \
  --agents <agents_dir> \
  --actions-module <module.path> \
  -s polling

三种 Flow 模式

Flow 模式 步骤数 协调方式 适用场景
doc_code_aligner.json Pipeline 5 步 Pipeline 显式串行 严格串行,每步依赖上一步结果
meta_review.json Pipeline 3 步 Pipeline 每步发事件 + 等 done 需要显式看到轮次阶段的编排
meta_review_event.json Event 1 步 Agent 自驱三轮Pipeline 仅启动+收结果 Agent 自治,最少编排干扰

选择建议:

  • 步骤间有数据依赖 → Pipeline 模式
  • 步骤间只是逻辑阶段划分 → Event 模式
  • 不确定 → 从 Event 模式开始

三轮元评审

2026-06-12 完成首次元评审3 Agent × 3 轮DeepSeek LLM 模式)。

共识结论P0

  1. _periodic_runner 异常传播缺失 — 后台任务静默失效,主循环不知情
  2. 复合状态栈取消安全 — 多个异步函数跨 await 点修改栈
  3. 事件广播非原子性 — 部分 Agent 收到事件,部分未收到

完整报告:bootstrap/data/meta_review_report.json66KB 查看摘要:bixiweave bootstrap status

目录结构

bootstrap/
  README.md           ← 入口文档
  ROADMAP.md          ← 路线图 + P0/P1 任务
  flows/              ← Pipeline/Event 流程定义DSL JSON
  agents/             ← Pipeline 模式 Agent 定义
  agents-meta/        ← Event 模式 Agent 定义(自驱三轮)
  actions/            ← 动作函数包
  data/               ← 运行产物

输出文件

文件 内容
data/gap_report.json 文档-代码差距清单
data/tag_report.json 模块标签
data/align_plan.json 对齐优先级计划
data/meta_review_report.json 三轮元评审报告

技术选型

  • Agent 框架bixiweave 自有(编译器 + 事件驱动运行时)
  • LLMDeepSeekdeepseek-chat),通过 DeepSeekProvider 统一调用
  • DSLJSON 定义状态机(bootstrap/flows/*.json
  • 模式Pipeline显式编排和 EventAgent 自驱)两种

相关链接