Skip to main content
Glama
README.md
<p align="right">
  <strong>简体中文</strong> · <a href="README.en.md">English</a>
</p>

<div align="center">
  <a href="https://wellkilo.github.io/RepoPilot/">
    <img
      src="docs/assets/brand/repopilot-logo.svg"
      width="520"
      alt="RepoPilot — Evidence-first AgentTeam"
    />
  </a>
  <br /><br />
  <p><strong>面向开源与企业研发团队的可审计仓库自治维护 AgentTeam</strong></p>
  <p>
    将 GitHub Issue 与失败 CI 安全推进到携带可验证执行证明的 Pull Request,
    也能在 Pull Request 更新时自动完成只读审查并维护一条结构化评论;
    全程保留 Agent、Skill、工具、审批、回滚点与经验证据。
  </p>
  <br />
</div>

<a href="https://wellkilo.github.io/RepoPilot/">
  <img
    src="docs/assets/brand/readme-hero.svg"
    width="100%"
    alt="RepoPilot 双闭环:从 Issue 到 Verified PR,从 Pull Request 到 Review Comment"
  />
</a>

<br />

<div align="center">
  <p>
    <a href="https://wellkilo.github.io/RepoPilot/">
      <img alt="Project Site" src="https://img.shields.io/badge/project_site-live-49d6d0?style=flat-square" />
    </a>
    <a href="https://github.com/wellkilo/RepoPilot/actions/workflows/ci.yml">
      <img alt="CI" src="https://img.shields.io/github/actions/workflow/status/wellkilo/RepoPilot/ci.yml?branch=main&label=CI&style=flat-square" />
    </a>
    <a href="LICENSE">
      <img alt="License" src="https://img.shields.io/badge/license-Apache--2.0-5c7cfa?style=flat-square" />
    </a>
    <a href="https://github.com/agentscope-ai/AgentTeams/releases/tag/v1.2.2">
      <img alt="AgentTeams" src="https://img.shields.io/badge/AgentTeams-v1.2.2-28a745?style=flat-square" />
    </a>
    <a href="https://glama.ai/mcp/servers/wellkilo/RepoPilot/score">
      <img alt="Glama MCP server score" src="https://glama.ai/mcp/servers/wellkilo/RepoPilot/badges/score.svg" />
    </a>
    <a href="https://github.com/wellkilo/RepoPilot/releases/latest">
      <img alt="GitHub Release" src="https://img.shields.io/github/v/release/wellkilo/RepoPilot?display_name=tag&style=flat-square" />
    </a>
    <img alt="Node.js" src="https://img.shields.io/badge/Node.js-%E2%89%A520-339933?style=flat-square&logo=nodedotjs&logoColor=white" />
    <img alt="Safety Policy" src="https://img.shields.io/badge/policy-PR--only-f59f00?style=flat-square" />
  </p>
  <p>
    <a href="https://wellkilo.github.io/RepoPilot/">项目网站</a> ·
    <a href="https://wellkilo.github.io/RepoPilot/#demo">在线 Demo</a> ·
    <a href="https://wellkilo.github.io/RepoPilot/?demoMode=review#demo">PR 自动评论演示</a> ·
    <a href="https://github.com/wellkilo/repopilot-testbed/pull/5#issuecomment-5378707979">真实 Review Comment</a> ·
    <a href="#使用过程演示">流程演示</a> ·
    <a href="#快速开始">快速开始</a> ·
    <a href="docs/architecture.md">架构</a> ·
    <a href="API.md">API / MCP</a> ·
    <a href="docs/security.md">安全</a> ·
    <a href="docs/demo.md">Demo</a> ·
    <a href="CONTRIBUTING.md">参与贡献</a>
  </p>
  <br />
</div>

<table>
  <tr>
    <td align="center"><strong>6</strong><br /><sub>不同职能 Agent</sub></td>
    <td align="center"><strong>15</strong><br /><sub>双传输 MCP 工具</sub></td>
    <td align="center"><strong>52/52</strong><br /><sub>控制面可靠性测试</sub></td>
    <td align="center"><strong>0</strong><br /><sub>未审批自动合并</sub></td>
  </tr>
</table>

> RepoPilot 建立在 [AgentTeams](https://github.com/agentscope-ai/AgentTeams) `v1.2.2`
> 之上,专注于安全、可审计的仓库维护自动化。默认策略为 `pull_request_only`:
> Agent 可以创建分支、提交和 Pull Request,但不能自动合并、删除分支、修改权限或密钥。

## 两条自动化闭环

<table>
  <thead>
    <tr>
      <th width="18%">入口</th>
      <th width="36%">自动执行</th>
      <th width="28%">交付物</th>
      <th width="18%">安全停止点</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><strong>Issue / Failed CI</strong></td>
      <td>分诊 → 根因定位 → 最小补丁 → 独立验证</td>
      <td>带 Proof Bundle 的 Pull Request</td>
      <td>停在开放 PR</td>
    </tr>
    <tr>
      <td><strong>Pull Request</strong></td>
      <td>固定 head SHA → 分页读取 Diff / Checks → Reviewer 审查</td>
      <td>创建或更新一条托管 Review Comment</td>
      <td>只评论,不批准、不改代码</td>
    </tr>
  </tbody>
</table>

PR 审查链路监听 `opened`、`reopened`、`synchronize` 与
`ready_for_review`。每次发布前都会重新核对当前 head SHA;如果审查期间出现新提交,
旧 Run 会被拒绝发布。评论带固定的 `<!-- repopilot-review -->` 标记,因此同一 PR
只维护一条 RepoPilot 评论,不会重复刷屏。

## 使用过程演示

<div align="center">
  <a href="https://wellkilo.github.io/RepoPilot/#demo">
    <img
      src="docs/assets/demo/repopilot-agentteam-demo.gif"
      width="100%"
      alt="RepoPilot 完整演示:Webhook 事件、Agent 分诊、根因定位、多文件补丁、并发验证与安全 PR"
    />
  </a>
  <p>
    <sub>
      公开 Issue #3 → 失败 CI → Repo Lead 分诊 → Locator 证明竞态 → Fixer 五文件修复 → Verifier 7/7 验证 → PR #4
    </sub>
  </p>
  <p>
    <a href="https://wellkilo.github.io/RepoPilot/#demo"><strong>打开 Issue → PR 交互 Demo ↗</strong></a>
    ·
    <a href="https://wellkilo.github.io/RepoPilot/?demoMode=review#demo"><strong>打开 PR → Comment 交互 Demo ↗</strong></a>
    ·
    <a href="https://github.com/wellkilo/repopilot-testbed/pull/5#issuecomment-5378707979"><strong>核验真实 Review Comment ↗</strong></a>
    ·
    <a href="docs/assets/demo/repopilot-agentteam-demo.mp4">观看高清 MP4</a>
    ·
    <a href="https://github.com/wellkilo/repopilot-testbed/pull/4">核验公开 PR #4</a>
  </p>
</div>

> 在线 Demo 无需模型服务或管理员账号。默认回放
> [`repopilot-testbed#3`](https://github.com/wellkilo/repopilot-testbed/issues/3)
> 的真实交付:失败基线稳定复现并发竞态,RepoPilot 通过
> `Types + Store + Processor + Tests + Docs` 五文件补丁修复,GitHub Actions
> 通过后创建 [`PR #4`](https://github.com/wellkilo/repopilot-testbed/pull/4)。
> PR 保持开放,合并权仍由人类持有。

<details open>
  <summary><strong>PR 自动评论会发布什么?</strong></summary>
  <br />

```md
<!-- repopilot-review -->

## RepoPilot PR Review

**Verdict:** NEEDS ATTENTION
**Reviewed revision:** `b504cec7c05cd2f3b84ee9c6ad7a3d3db6eead5c`

### Findings

| Severity | Finding                                | Location                          |
| -------- | -------------------------------------- | --------------------------------- |
| HIGH     | 发布前没有重新校验当前 head SHA        | `src/reviews/publisher.ts:19`     |
| MEDIUM   | 固定只扫描前 100 条评论                | `src/reviews/github-client.ts:43` |
| HIGH     | GitHub 写入失败仍记录“已发布” Evidence | `src/reviews/publisher.ts:31`     |
```

以下结果来自公开的
<a href="https://github.com/wellkilo/repopilot-testbed/pull/5">PR #5</a>
包含 5 个文件、373 行新增,GitHub Actions
<a href="https://github.com/wellkilo/repopilot-testbed/actions/runs/32557838055">CI 已通过</a>;
RepoPilot 仍从真实 Diff 中发现 2 条 HIGH 与 1 条 MEDIUM 语义问题,并发布了
<a href="https://github.com/wellkilo/repopilot-testbed/pull/5#issuecomment-5378707979">公开 Review Comment</a>。
评论由 <code>repopilot-reviewer</code> 使用
<code>pull-request-review</code> Skill 生成,并通过
<code>repopilot_publish_review_comment</code> 发布。工具会校验 Run、仓库、
PR 编号、运行中的 Reviewer Step 和不可变 head SHA,成功后追加
<code>review_publication</code> Evidence。可下载
<a href="docs/assets/demo/pr-review-run.json">脱敏 Run Proof JSON</a>
核验 Run ID、Step、8 条 Evidence 与链头哈希。
</details>

## 维护闭环

<div align="center">

```text
GitHub Issue / Failed CI
          │
          ▼
   Repo Lead 分诊与拆解
          │
          ▼
 Locator 根因定位 ──► Fixer 最小修复 ──► Verifier 独立验证
                                                │
                  人工审批 ◄── 高风险门禁 ◄─────┤
                                                │
                                                ▼
                                      Archivist 沉淀 Runbook

GitHub Pull Request
          │
          ▼
 Reviewer 固化 head SHA ──► 分页读取 Diff / Checks ──► 更新托管 Review Comment
```

</div>

每个关键阶段都会把决策、工具调用、Git 引用、CI 结果和审批事件写入
PostgreSQL 追加式 SHA-256 证据链,并通过 OpenTelemetry Trace 与证据控制台支持回放。

## Proof-Carrying Pull Request

RepoPilot 不把“自动生成 PR”作为终点,而是让每个 PR 携带一份机器可核验的
**Proof Bundle**:

```text
Run 身份 + AgentTeams Step 时间线 + Skill 版本
         + 工具与决策 Evidence + Git / CI 引用
         + 审批历史 + SHA-256 链根 + 确定性质量门禁
```

```bash
curl http://127.0.0.1:3000/api/v1/runs/<run-id>/proof \
  --output artifacts/proof-bundle.json
pnpm build
pnpm evaluate artifacts/proof-bundle.json artifacts/evaluation-report.json
```

Proof Score 衡量证明完整性,不把控制面测试冒充模型修复质量;补丁正确性仍由公开
测试床、独立 Verifier 与 GitHub Checks 判定。

完成 Runbook 归档后,Archivist 调用 `repopilot_publish_proof_comment`,将脱敏后的
完整性结果、Agent/Skill 执行结果和 SHA-256 链根幂等发布到对应 PR。重复执行会更新
同一条评论,因此 Proof 真正随 PR 交付,而不是只存在于控制面 API。

## 为什么是 RepoPilot

<table>
  <thead>
    <tr>
      <th>问题</th>
      <th>RepoPilot 的处理方式</th>
      <th>可验证证据</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Issue 分诊依赖人工</td>
      <td>Repo Lead 统一分类、风险判断和 DAG 拆解</td>
      <td>任务计划、Matrix 事件、Run 状态</td>
    </tr>
    <tr>
      <td>自动修复容易直接猜答案</td>
      <td>Locator 与 Fixer 职责分离,先复现和证明根因</td>
      <td>复现命令、代码位置、影响面、补丁</td>
    </tr>
    <tr>
      <td>修复者自行验证存在偏差</td>
      <td>Verifier 独立运行 before/after 测试与 GitHub Checks</td>
      <td>测试结果、Check Runs、残余风险</td>
    </tr>
    <tr>
      <td>高风险动作缺少控制</td>
      <td>合并等动作要求带版本号的一次性人工审批</td>
      <td>审批人、意见、版本、消费时间</td>
    </tr>
    <tr>
      <td>经验无法复用</td>
      <td>Archivist 查重、脱敏并写入 Runbook</td>
      <td>来源 Run、证据链、检索结果</td>
    </tr>
  </tbody>
</table>

## AgentTeam

<table>
  <thead>
    <tr>
      <th width="18%">Agent</th>
      <th width="42%">职责</th>
      <th width="40%">自主边界</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><strong>Repo Lead</strong></td>
      <td>分诊、风险判断、DAG 拆解、任务委派</td>
      <td>不修改代码;高风险动作必须发起审批</td>
    </tr>
    <tr>
      <td><strong>Locator</strong></td>
      <td>复现、代码/符号定位、影响面分析</td>
      <td>仅读取和实验,不修改仓库</td>
    </tr>
    <tr>
      <td><strong>Fixer</strong></td>
      <td>最小补丁、回归测试、分支、提交、PR</td>
      <td>停在 Pull Request,不合并、不强推</td>
    </tr>
    <tr>
      <td><strong>Verifier</strong></td>
      <td>独立复现、测试、CI 和残余风险验证</td>
      <td>不修改补丁,不把绿灯视为合并授权</td>
    </tr>
    <tr>
      <td><strong>Archivist</strong></td>
      <td>Runbook 查重、脱敏、结构化和沉淀</td>
      <td>不修改仓库或 GitHub 状态</td>
    </tr>
    <tr>
      <td><strong>Reviewer</strong></td>
      <td>按不可变 head SHA 审查 PR 并发布结构化评论</td>
      <td>不审批、不改代码、不合并</td>
    </tr>
  </tbody>
</table>

Agent Identity 完整定义位于
[`deploy/agentteams/repopilot-team.yaml`](deploy/agentteams/repopilot-team.yaml),
Skill 契约位于 [`skills/`](skills/)。

## 核心能力

<details open>
  <summary><strong>AgentTeams 原生协作</strong></summary>
  <br />
  使用官方 <code>agentteams.io/v1beta1</code> Worker/Team CRD、Team Leader、
  Matrix 房间、共享任务状态与 MinIO 工作区,而不是自建多 Agent 模拟器。
</details>

<details>
  <summary><strong>Skill 与 MCP 工程化</strong></summary>
  <br />
  提供 6 个 Apache-2.0 自定义 Skill 与统一版本化 Manifest;控制面暴露 14 个
  MCP 工具,并同时提供 Streamable HTTP 与 stdio 入口,覆盖 Agent Step、Evidence、
  审批、Runbook、Issue、PR、Changed Files、Checks、PR Review Comment、
  PR Proof Comment 和受控合并。
</details>

<details>
  <summary><strong>不可变执行证据</strong></summary>
  <br />
  Evidence 使用 canonical JSON 与 SHA-256 哈希链;数据库触发器拒绝更新和删除。
  控制台会重新验证完整链路并展示 <code>CHAIN VERIFIED</code>。
</details>

<details>
  <summary><strong>生产级安全边界</strong></summary>
  <br />
  包含 GitHub 仓库 allowlist、Webhook HMAC 验签、delivery 并发幂等、显式状态机、
  审批乐观锁和审批一次性消费。
</details>

<details>
  <summary><strong>RAG 与可观测</strong></summary>
  <br />
  PostgreSQL 提供 Runbook 全文检索并预留 pgvector;可选接入阿里云官方
  <code>alibabacloud-agentloop-experience</code> Skill。OpenTelemetry 通过 OTLP
  输出 HTTP、Agent Skill、MCP 与端到端 Run Trace 和 Metrics。
</details>

## MCP Registry

<div align="center">
  <a href="https://glama.ai/mcp/servers/wellkilo/RepoPilot">
    <img
      src="https://glama.ai/mcp/servers/wellkilo/RepoPilot/badges/card.svg"
      width="380"
      alt="RepoPilot 在 Glama 的 MCP 服务动态评分卡"
    />
  </a>
  <p>
    <sub>评分卡由 Glama 根据公开仓库与 Release 动态生成;点击可查看实时结果和检查明细。</sub>
  </p>
</div>

RepoPilot 为 MCP Registry 的静态检查与托管发布提供可复现入口:

| 检查项   | 仓库中的可验证实现                                                               |
| -------- | -------------------------------------------------------------------------------- |
| 许可证   | 根目录包含标准 Apache License 2.0 全文                                           |
| 所有权   | [`glama.json`](glama.json) 声明 GitHub 维护者                                    |
| 可构建性 | [`Dockerfile`](Dockerfile) 提供非 root 生产镜像;根级 stdio 启动器加载独立运行包 |
| 工具定义 | 15 个工具均提供调用边界、参数语义和标准 MCP 安全注解                             |
| 防回退   | 发布验证从独立运行包执行 `initialize` 和 `tools/list`,校验 15 个工具和启动入口  |

MCP 工具发现不需要模型或 GitHub 凭证;只有数据库或 GitHub 读写工具在调用时依赖对应
运行时服务与 Secret。完整部署契约见 [`docs/deployment.md`](docs/deployment.md)。

## 系统架构

```mermaid
flowchart LR
    GH[GitHub Issue / Failed CI / Pull Request] --> CP[RepoPilot Control Plane]
    CP --> DB[(PostgreSQL + pgvector)]
    CP --> MX[Matrix Admin → Manager DM]
    MX --> M[AgentTeams Manager]
    M --> TL[Repo Lead]
    TL --> L[Locator]
    TL --> F[Fixer]
    TL --> V[Verifier]
    TL --> A[Archivist]
    M --> R[Reviewer]
    L & F & V & A --> MCP[RepoPilot MCP via Higress]
    R --> MCP
    MCP --> GHAPI[GitHub REST API]
    MCP --> DB
    DB --> UI[Evidence Console]
    CP --> OTEL[OTLP / AgentLoop / LoongSuite]
```

更多设计细节见 [`docs/architecture.md`](docs/architecture.md)。

## 工程结构

```text
RepoPilot/
├── apps/
│   ├── control-plane/       # Fastify REST / Webhook / MCP / 审批 / 证据账本
│   └── console/             # 飞行记录器风格 React 证据控制台
├── packages/contracts/      # Zod Schema、共享类型和显式状态机
├── deploy/agentteams/       # AgentTeams v1.2.2 Worker / Team 清单
├── skills/                  # 6 个可复用 RepoPilot Skills
├── evaluation/              # Proof Bundle 协议与可靠性 Benchmark
├── scripts/                 # Skill 校验、可靠性基线与离线评测
├── docs/                    # 架构、安全、部署和 Demo 文档
├── CONTRIBUTING.md          # 开发流程、质量门禁与贡献规范
├── Dockerfile               # Streamable HTTP Control Plane 生产容器
├── glama.json               # Glama MCP Registry 维护者声明
├── API.md                   # REST / Webhook / MCP 出入参
├── Method.md                # 外部 SDK、HTTP Method 与调用契约
└── docker-compose.yml       # PostgreSQL 16 + pgvector
```

## 快速开始

### 环境要求

- Node.js `20+`
- pnpm `9+`
- Docker Desktop / Docker Engine

模型凭证不是构建、测试或本地控制面运行的前置条件。

```bash
git clone https://github.com/wellkilo/RepoPilot.git
cd RepoPilot
cp .env.example .env
docker compose up -d postgres
pnpm install --registry=https://registry.npmjs.org
pnpm build
pnpm --filter @repopilot/control-plane start
```

访问控制台:

```text
http://127.0.0.1:3000
```

也可以使用一键初始化:

```bash
./init.sh
```

### 生产容器

根目录 `Dockerfile` 会构建 Console、共享契约与 Control Plane,并以非 root 用户启动
同一个生产进程:

```bash
docker build -t repopilot:local .
docker run --rm -p 3000:3000 \
  -e DATABASE_URL=postgres://repopilot:repopilot@host.docker.internal:5432/repopilot \
  -e GITHUB_ALLOWED_REPOSITORIES=wellkilo/repopilot-testbed \
  repopilot:local
```

MCP 客户端连接 `http://127.0.0.1:3000/mcp`。需要读取或写入 GitHub 时,再通过运行时
Secret 注入 `GITHUB_TOKEN`;镜像内不包含凭证。

### stdio MCP

Registry 或本地 MCP 客户端需要 stdio 时,先生成独立运行包,再启动根入口:

```bash
pnpm glama:build
pnpm glama:verify
node mcp-server.mjs
```

`glama:verify` 会在不提供数据库或 GitHub 凭证的环境中完成真实 MCP 初始化并校验
15 个工具。工具发现不连接外部服务;实际执行数据或 GitHub 操作时仍必须提供真实服务
与凭证。

### 创建首个 Run

```bash
curl -X POST http://127.0.0.1:3000/api/v1/runs \
  -H 'Content-Type: application/json' \
  -d '{
    "source": {
      "type": "github_issue",
      "repository": "wellkilo/repopilot-testbed",
      "issueNumber": 1
    },
    "executionPolicy": "pull_request_only"
  }'
```

需要读取 GitHub Issue 时,在本机 `.env` 配置 `GITHUB_TOKEN`。如果没有配置
AgentTeams Matrix,Run 会停在 `awaiting_dispatch`,不会用 Mock Agent 伪造执行结果。

绑定仓库 Webhook 的 `Pull requests` 事件后,非 Draft PR 的创建、重新打开、推送新
提交或转为 Ready for review 都会触发独立审查 Run。Reviewer 读取 PR、分页 diff 和
Checks,并幂等创建或更新一条 `RepoPilot PR Review` 评论;若 PR 在审查期间产生新
提交,旧 Run 会因 head SHA 不一致而拒绝发布。

## AgentTeams 真实协作

真实 Agent 推理需要一个 OpenAI 兼容模型端点,可以使用:

- 阿里云百炼等托管服务;
- 其他 OpenAI 兼容 API;
- 本地 Ollama 等兼容端点。

模型密钥只交给 AgentTeams/Higress,不进入 RepoPilot 源码、数据库或部署清单。

部署说明:

- [`docs/deployment.md`](docs/deployment.md)
- [`deploy/agentteams/README.md`](deploy/agentteams/README.md)

## 可复现测试床

<table>
  <tr>
    <td><strong>仓库</strong></td>
    <td><a href="https://github.com/wellkilo/repopilot-testbed">wellkilo/repopilot-testbed</a></td>
  </tr>
  <tr>
    <td><strong>Issue</strong></td>
    <td><a href="https://github.com/wellkilo/repopilot-testbed/issues/3">#3 · Duplicate webhook retries dispatch multiple maintenance tasks</a></td>
  </tr>
  <tr>
    <td><strong>失败基线</strong></td>
    <td><a href="https://github.com/wellkilo/repopilot-testbed/actions/runs/32444544920">GitHub Actions Run 32444544920</a></td>
  </tr>
  <tr>
    <td><strong>修复 PR</strong></td>
    <td><a href="https://github.com/wellkilo/repopilot-testbed/pull/4">Pull Request #4 · 5 files · +75 / -22</a></td>
  </tr>
  <tr>
    <td>绿色 CI</td>
    <td><a href="https://github.com/wellkilo/repopilot-testbed/actions/runs/32444690068">GitHub Actions Run 32444690068 · 7/7 tests</a></td>
  </tr>
  <tr>
    <td><strong>Review PR</strong></td>
    <td><a href="https://github.com/wellkilo/repopilot-testbed/pull/5">Pull Request #5 · 5 files · +373 / -0</a></td>
  </tr>
  <tr>
    <td><strong>Review Comment</strong></td>
    <td><a href="https://github.com/wellkilo/repopilot-testbed/pull/5#issuecomment-5378707979">2 HIGH + 1 MEDIUM · revision b504cec</a></td>
  </tr>
  <tr>
    <td>Review CI / Proof</td>
    <td><a href="https://github.com/wellkilo/repopilot-testbed/actions/runs/32557838055">GitHub Actions Run 32557838055</a> · <a href="docs/assets/demo/pr-review-run.json">8-entry evidence chain</a></td>
  </tr>
</table>

测试床包含一个确定性并发缺陷:相同 GitHub delivery 的两个请求可同时穿透
`find` / `save` 窗口,创建两个 task 并执行两次 dispatch。RepoPilot 将
create-or-reuse 收口到 `DeliveryTaskStore.getOrCreate`,使相同 delivery
共享一个 in-flight Promise,并补充顺序重试和不同 delivery 的负对照。
PR 保持开放,便于审查且未触发自动合并。

PR Review Demo 使用独立的公开
[`PR #5`](https://github.com/wellkilo/repopilot-testbed/pull/5):代码可编译、5 项测试与
GitHub Actions 均通过,但 Reviewer 没有把绿色 CI 等同于代码正确。它逐页读取 5 个变更文件,
在固定 revision `b504cec` 上识别 stale SHA、评论分页和失败 Evidence 三个语义缺陷,
并通过真实 GitHub REST 发布同一条托管评论。该 Run 的 `review_publication` 记录与 8 条
哈希链 Evidence 已脱敏导出到
[`docs/assets/demo/pr-review-run.json`](docs/assets/demo/pr-review-run.json)。

## 验证

```bash
pnpm typecheck
pnpm benchmark:reliability
pnpm skills:validate
pnpm lint
pnpm format:check
pnpm build
```

当前控制面可靠性基线为 `52/52`。测试覆盖状态机、Webhook 验签、证据哈希、数据库
不可变触发器、delivery 并发幂等、审批版本与一次性消费、Agent Skill Step 生命周期、
Proof Bundle 完整性校验、PR Review 来源与 stale SHA 防护、HTTP 冲突语义及控制台标签。
CI 生成结构化 JSON 报告。

## 安全边界

<table>
  <tr>
    <th>默认允许</th>
    <th>必须人工审批</th>
  </tr>
  <tr>
    <td>
      读取 Issue / PR / CI、创建分支与提交、推送非保护分支、创建 Pull Request、
      创建或更新托管审查评论、读取 Checks、记录 evidence
    </td>
    <td>
      合并 Pull Request、删除分支、破坏性回滚、修改权限、修改密钥、执行其他高风险工具
    </td>
  </tr>
</table>

详细威胁模型与生产加固项见 [`docs/security.md`](docs/security.md)。

## 文档导航

| 文档                                           | 内容                                                    |
| ---------------------------------------------- | ------------------------------------------------------- |
| [`API.md`](API.md)                             | REST、Webhook 和 MCP Schema                             |
| [`Method.md`](Method.md)                       | AgentTeams、Matrix、GitHub、PostgreSQL 和 OTel 方法契约 |
| [`docs/architecture.md`](docs/architecture.md) | 架构、状态机和部署剖面                                  |
| [`docs/security.md`](docs/security.md)         | 权限、审批、凭证和 evidence 完整性                      |
| [`docs/deployment.md`](docs/deployment.md)     | 本地、AgentTeams、Webhook 和可观测部署                  |
| [`docs/demo.md`](docs/demo.md)                 | 公开复现流程、运行证据与失败分支                        |
| [`evaluation/README.md`](evaluation/README.md) | 可靠性分层、Proof Bundle 和 Benchmark                   |
| [`docs/roadmap.md`](docs/roadmap.md)           | 工程路线图与待完善能力                                  |
| [`CONTRIBUTING.md`](CONTRIBUTING.md)           | 开发环境、质量门禁和贡献流程                            |

## 当前边界

- 未配置模型服务时,不能完成真实 AgentTeams 推理;构建、测试、控制面和测试床不受影响。
- Runbook 默认使用 PostgreSQL 全文检索;`vector(1536)` 已为语义召回预留。
- AgentLoop Recall 是可选能力,没有凭证时自动降级到本地 Runbook。
- 控制台审批身份当前通过受信反向代理 Header 演示;生产环境必须接入 OIDC/SSO。

<hr />

<div align="center">
  <p>
    <strong>RepoPilot</strong> · Make repository automation observable, reviewable and reversible.
  </p>
  <p>Apache-2.0</p>
</div>

TDQS

A4.4/5.0

Scored across 14 tools

Disambiguation5/5

Each tool has a clearly distinct purpose with detailed descriptions. The two publish comment tools are distinguished by run type (proof vs review), and the start/finish step pair is unambiguous. GitHub tools cover specific resource actions with no overlap.

Naming Consistency4/5

Tools follow a consistent prefix-verb-noun pattern (repopilot_ and github_ prefixes). Minor inconsistency: get vs list for PR checks vs files, but overall convention is predictable and readable.

Tool Count5/5

14 tools is within the ideal 3-15 range and well-scoped for maintenance automation integrating RepoPilot orchestration and GitHub operations. Each tool fills a specific role without redundancy.

Completeness4/5

Core lifecycles are covered: step start/finish, evidence chain, approval, runbook search/write, and GitHub PR review/merge flow. Minor gaps exist (no explicit step abort, no runbook listing or evidence query), but agents can complete primary workflows without dead ends.

Maintenance

ActivityMaintained
ResponsivenessNo issues