Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
9ba295a
fix(session): 融合输入、上下文与恢复缺陷修复
xiaoland Oct 11, 2026
f42a226
feat(collaboration): 增加自有本地协作空间
xiaoland Oct 11, 2026
4895ec4
feat(console): 反哺可观测性与本地 Web 控制台
xiaoland Oct 11, 2026
1fdef82
ref(collaboration): 将内建平台与 GitHub 作为同层上游
xiaoland Oct 11, 2026
3fab0d0
fix(runtime): 修复双上游真实验收中的运行与控制缺陷
xiaoland Oct 11, 2026
2808c89
docs(acceptance): 记录 MiniMax 双上游真实验收与失败边界
xiaoland Oct 11, 2026
12c328c
fix(pi): 反哺原生插件生命周期与执行归属
xiaoland Oct 11, 2026
1394319
chore(pi): 保留统一补丁输入的上游格式
xiaoland Oct 11, 2026
89505d9
fix(pi): 交付独立 Node 原生运行时
xiaoland Oct 11, 2026
d9f52d9
fix(pi): 避免空闲 readiness 反复扫描原生材料
xiaoland Oct 11, 2026
a419b74
docs(acceptance): 记录 GitHub 与 Pi 本轮验收及降载收尾
xiaoland Oct 11, 2026
b99df0c
docs(readme): 融合远端介绍改版与反哺入口
xiaoland Oct 12, 2026
e7615e9
feat(run): 加入 root 驱动的自主运行模式
xiaoland Oct 12, 2026
861a15d
fix(run): 保留指派输入并先处理启动上下文替换
xiaoland Oct 12, 2026
9e62be1
fix(pi): 使用显式环境启动受控 Bash
xiaoland Oct 12, 2026
3d7e712
fix(store): 提前取得内建协作写入事务的准入
xiaoland Oct 12, 2026
4d459e6
docs(acceptance): 记录 MiniMax ARC lite 整轮失败与收尾
xiaoland Oct 12, 2026
f82ee88
feat(profile): 反哺独立协作技能与 Pi 材料能力
xiaoland Oct 12, 2026
c2dafbc
docs(profile): 记录反哺候选发布与资格边界
xiaoland Oct 12, 2026
50f25c8
fix(ci): 修复 Rust 严格 Clippy 检查失败
xiaoland Oct 12, 2026
ea92d2c
ref(pi): 收敛公开 SDK 与插件发行边界
xiaoland Oct 12, 2026
e80e2d9
feat(brand): 整合新版 Braid Logo 素材与界面入口
xiaoland Oct 19, 2026
fdb2bb6
fix(config)!: 仅通过 secret 文件配置 Provider 凭据
xiaoland Nov 3, 2026
95727f4
fix(config)!: 解耦 runtime adapter 与 LLM provider
xiaoland Nov 3, 2026
d19f012
fix(config)!: 清除 provider 伪默认与假元数据
xiaoland Nov 3, 2026
7aadd34
feat(github): 支持多仓库实例与 headless setup
xiaoland Nov 3, 2026
d19773e
fix(setup): 在外部副作用前校验必需工具
xiaoland Nov 3, 2026
b972f0c
docs(github): 明确多仓库 adapter 限制
xiaoland Nov 3, 2026
0560492
fix(runtime): 按实际 Agent Group 数汇总健康状态
xiaoland Nov 3, 2026
9b09304
fix(config): 强制同仓库 Profile 共享 source checkout
xiaoland Nov 3, 2026
0cb9082
docs(github): 澄清跨仓库关联不共享调度
xiaoland Nov 3, 2026
d2e82a5
fix(pi): 不冒称 keyless OAuth 可运行
xiaoland Nov 4, 2026
a704626
feat(config)!: 建立 Braid 凭据模型与 Pi OAuth 渲染
xiaoland Nov 5, 2026
caed5c3
feat(config)!: models.json 由 adapter 从 provider 声明派生
xiaoland Nov 5, 2026
f9309f5
fix(reconcile): 修复 dogfood 发现的网络与新仓库缺陷
xiaoland Nov 6, 2026
5b0c9b2
fix(native): 对齐上游会话路径判定,修复 fresh subagent 必失败
xiaoland Nov 6, 2026
60179b6
fix(github): 限制历史巡检并共享 installation 配额退避
xiaoland Nov 11, 2026
2884cf7
fix(writer): persist publication requests for runtime-owned convergence
xiaoland Nov 12, 2026
58b1a64
fix(writer): bind publications to observed current turns across surfaces
xiaoland Nov 12, 2026
3f172fe
fix(telemetry): isolate full evidence from ordinary diagnostics
xiaoland Nov 12, 2026
719371a
fix(telemetry): isolate raw SDK and exporter diagnostics
xiaoland Nov 12, 2026
3165e67
fix(publication): bind source identity and maintain canonical bodies …
xiaoland Nov 12, 2026
920bb4e
fix(writer): fail closed on body relationship changes
xiaoland Nov 12, 2026
b7e530a
fix(writer): allow native closing text in authorized body maintenance
xiaoland Nov 12, 2026
373c6d7
feat(handoff): deliver explicit Issue design wakes to existing PR gen…
xiaoland Nov 12, 2026
75c9a92
fix(handoff): retire invalid delivered wakes without blocking other i…
xiaoland Nov 12, 2026
5c76ab1
feat(reading): measure GraphQL reads and combine stateless first pages
xiaoland Nov 12, 2026
ffe6e12
fix(github): require resource for comparable rate-limit usage
xiaoland Nov 12, 2026
3cd97fb
test(dogfood): verify integrated publication and canonical reads in CI
xiaoland Nov 12, 2026
43cb261
fix(cli): run gh read on the existing tokio runtime
xiaoland Nov 12, 2026
6ec0d33
ops: add retained authenticated single-host dogfood backend
xiaoland Nov 12, 2026
325f01d
ops: expand file secret for LGTM direct Grafana startup
xiaoland Nov 12, 2026
92e8a87
docs(ops): allow non-root Collector to read managed config
xiaoland Nov 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Unified patches retain upstream context markers and indentation.
native/pi/patches/*.patch -whitespace
13 changes: 10 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ jobs:
- run: cargo fmt --check
- run: cargo check --locked --all-targets
- run: cargo clippy --locked --all-targets -- -D warnings
- run: |
archive=$(scripts/package.sh)
scripts/tests/00_clean_install.sh "$archive"

linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: rustup toolchain install 1.93.0 --profile minimal --component clippy,rustfmt --target x86_64-unknown-linux-gnu
- run: cargo fmt --check
- run: cargo check --locked --all-targets
- run: cargo clippy --locked --all-targets -- -D warnings
- run: cargo test --locked --all-targets
77 changes: 77 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: release

on:
push:
tags:
- "v*"
workflow_dispatch:
inputs:
version:
description: "Release tag (for example v0.3.3)"
required: true

permissions:
contents: write

jobs:
build:
strategy:
matrix:
include:
- os: macos-14
target: aarch64-apple-darwin
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- run: rustup toolchain install 1.93.0 --profile minimal --target ${{ matrix.target }}
- run: cargo build --locked --release
- name: Package release artifact
shell: bash
run: |
set -euo pipefail
version="${{ github.event.inputs.version || github.ref_name }}"
package="braid-${version}-${{ matrix.target }}"
rm -rf "$package" "${package}.tar.gz" "${package}.tar.gz.sha256"
mkdir -p "$package"
cp target/release/braid "$package/braid"
cp LICENSE README.md config.example.toml "$package/"
tar -czf "${package}.tar.gz" "$package"
shasum -a 256 "${package}.tar.gz" > "${package}.tar.gz.sha256"
- uses: actions/upload-artifact@v4
with:
name: release-${{ matrix.target }}
path: |
braid-*.tar.gz
braid-*.tar.gz.sha256
if-no-files-found: error

release:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
path: dist
- name: Create GitHub Release
shell: bash
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -euo pipefail
tag="${{ github.event.inputs.version || github.ref_name }}"
version="${tag#v}"
awk -v section="## [${version}]" '
$0 == section { include = 1; next }
include && /^## \[/ { exit }
include { print }
' CHANGELOG.md > release-notes.md
test -s release-notes.md
assets=(dist/release-*/*.tar.gz dist/release-*/*.tar.gz.sha256)
if gh release view "$tag" >/dev/null 2>&1; then
gh release upload "$tag" "${assets[@]}" --clobber
else
gh release create "$tag" "${assets[@]}" --title "$tag" --notes-file release-notes.md
fi
8 changes: 6 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Braid Project Instructions

This repository implements Braid: GitHub Issue and pull-request state become the
durable working memory of local Coding Agents. Apply these instructions only in
This repository implements Braid: collaboration Issue and pull-request state become
the durable working memory of Coding Agents. GitHub and the built-in platform are
peer upstreams; the Web Console belongs to Braid as a whole. Apply these instructions only in
this repository; do not modify user-scope Agent instructions.

<!-- svc:begin navigation sha256=48c8d7b497ed094589c4a192f3ef97450fd7f614712dc1b4b22e9a20578360cd -->
Expand All @@ -26,6 +27,9 @@ Use the installed `svc` CLI when SVC guidance or project integration is relevant
- Project vocabulary: `docs/10-prd/glossary.md`
- Volatile task control: `tasks/`; retain at most one active packet and delete
it when the task closes after promoting binding truth.
- Optional collaboration method: `skills/README.md` lists independent skills
with name, description and file path. Discover and read them on demand; do not
inline skill bodies into prompts or make them a runtime prerequisite.

## GitHub Working Memory Protocol

Expand Down
124 changes: 124 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,126 @@
All notable changes to Braid are recorded here. The project follows Semantic
Versioning once release artifacts are published.

## [Unreleased]

### Added

- `braid gh status` 可按公开 request ID 查询发布回执。CLI 本地接收与唯一 outbox
执行义务原子落库;前置读取限流、CLI 退出及服务重启后仍能继续收敛,结果不确定时
先核对远端,避免重复评论或 PR。
- `braid gh pr|issue read/edit` 通过 canonical snapshot 维护标题和正文;PR Agent
可修正当前直接关联的开放 Issue,仍保留 PR 角色归因。编辑检查已读版本并保护已识别
的 ensure/closing 来源;不声称 GitHub 支持原子 CAS 或关系集合恒定。
- `braid gh pr handoff` 显式交付 Issue 新设计到已有关联 PR 的下一安全边界,按稳定
request ID 去重并绑定目标 generation;不创建 Group、不打断当前 turn,也不从
App 评论或 `@braid` 推断交接。已失效的交接输入不再阻塞同批合法输入或 Finalization。

### Changed

- Agent 的 `braid gh` 写命令必须携带当前 runtime 输入提供的 `--source-turn`;
`--profile` 不能替换 source 身份。人工调用使用显式 `--operator`,且不能在已登记
Agent worktree 内降级为人工身份。旧脚本需按新 help 更新。
- 完整采样证据仅进入专用 OTLP logs,不再复制到普通 Text/JSON journal 或 trace
events。启用 payload 留存的后端必须接收 logs,并明确访问、保留和销毁策略。
新增仅供短期 loopback 验证的 Collector→LGTM 模板,无默认二次抽样;SDK 导出统计
不等于持久存储确认,未知丢弃数不显示为零。
- GraphQL 增加 operation、前后台、配额窗口和真实返回 cost 归因;REST/App-token
不在该统计覆盖内。完整 Context 首屏静态合并后,无项目、关联或线程的单页 mock
HTTP 账单由 Issue 13→5、PR 10→5;保留分页和前后 marker,不推断线上 points 同降。
- `status` 分开显示原始 runnable 数、durable 领取资格及当前/历史代;物理 provider
可用性仍明确未知,不因对象 closed/merged 就删除可能合法的 Finalization。
- Harness schema 升至 **10**;配置 schema 保持 3。升级前须停止旧 runtime 并执行
带备份的迁移。旧 schema 8 binary 不能打开升级后的账本;回滚需停止新 runtime,
将升级前备份恢复到独立 runtime 目录,不支持 down migration。

### Fixed

- GitHub 巡检不再每分钟完整重读所有历史 Work Item:OPEN 或仍有存活 Assignment
的条目默认 60 秒,已完成收尾的终态历史项 30 分钟。Schema 8 独立记录完整成功与
尝试时钟,失败不导致每 5 秒本地检查都重新联网;跨仓库按最久未尝试优先,单项
失败不阻断后续对象,成功项不因其他项失败或重启反复读取。升级需要迁移数据库。
- GraphQL 请求统一采集 installation 预算并共享准入/冷却。后台保留前台余量,遵守
reset/Retry-After,缺提示限流和网络错误有界退避、到期自动探测;首次限流即保留
写入重试资格。已准入请求含响应解析限时 30 秒;关闭隐式 transport 重试,REST
429 仍交由持久写入队列恢复。派生客户端共享自动刷新 token 缓存,而不是复制缓存。
此机制不协调进程外消费者,不自动解除业务 blocked,也不声称已测得线上节省量。

## [0.3.3] - 2026-10-13

### Changed

- Runtime adapter 与 LLM provider 解耦:`setup`/`init` 使用 `--adapter`
选择 Pi/Codex;Pi 需要显式 `--llm-provider` 和 `--model`,仅使用 API key
的 route 才需要 `--api-key-file`。Codex 继续使用隔离 provider home,不再
生成或引用伪造的 LLM API key 文件。Braid 不再生成硬编码 reasoning、协议
或费用配方。
- Provider 凭据改为显式 `credential = { kind = "api_key" | "oauth" | "none", file }`
声明,文件为 Braid schema(`provider_api_key` 或 OAuth token set),不是任何
runtime 的文件格式。Pi adapter 在材料化时转换:`api_key` 注入
`BRAID_PROVIDER_API_KEY`,`oauth` 渲染 session home 的 `auth.json`,`none`
显式 keyless。凭据为静态秘密,内容 hash 进入 Profile 有效版本。
- 新增 `braid provider import-auth` 一次性把 Pi 原生 `auth.json` 转换进 Braid
secrets;runtime home 中的 `auth.json` 一律拒绝并指向该工具。
- Pi 的 `models.json` 改为由 Pi adapter 从 `llm_providers` 声明派生:`base_url`、
可选 `api` 与 `[[llm_providers.models]]` 能力元数据按声明渲染,`apiKey` 仅在
`credential.kind = "api_key"` 时出现。模板或 runtime home 中的 `models.json`
在 schema 3 被明确拒绝;schema 2 保持旧模板路径可读。
- `setup`/`init` 不再支持 `--api-key-environment`/`api_key_environment` 与
`--api-key-file`/`api_key_file`(schema 3);改用
`--llm-credential-kind` 与 `--llm-credential-file`。schema 2 的旧字段继续
惰性兼容。Pi 原生材料统一引用 Braid 管理的进程内 `BRAID_PROVIDER_API_KEY`,
旧配置须显式迁移,不会自动导入旧环境变量。
- 一个 GitHub instance 可以服务多个显式配置的 repository。GitHub App、
webhook、进程与 runtime catalogs 共享;Profile、workspace、调度、worktree、
mention、outbox、reconcile 和 `pr ensure` 均按 repository 路由。多仓库配置
中每个 Profile 必须声明 repository 和显式 workspace,`braid gh pr ensure`
必须显式 `--repository`。
- `setup --no-browser` 改为可完成的 headless 两段流程:保留 pending setup
draft,随后用完整 `--callback-url` 完成 App conversion 和 instance 写入;
state 不匹配会拒绝。setup 默认 webhook 事件补齐 `issue_dependencies` 和
`pull_request_review_thread`,Linux 下不再硬编码 Homebrew `gh` 路径。
- 新增 `braid assignment reactivate`:对已 blocked 的 open Work Item 显式
排队新的 activation generation;不会静默恢复不兼容 Profile session。
- Release workflow 同时构建 macOS arm64 和 Linux x86_64 预编译产物;doctor
的不可达 OTLP endpoint 降级为可选警告,不再阻断本机 runtime readiness。

### Fixed

- dogfood 修复:新增 repository 的首次 reconcile 不再因 repositories 行缺失
触发外键失败(begin 时 upsert),无 tracked work item 的仓库跳过空转周期,
且任一仓库的 reconcile 失败不再中止其他仓库。
- GitHub 连接建立改为每步 30 秒有界超时并携带操作上下文,网络故障时启动
不再静默挂起数分钟;App webhook 恢复与隧道修复同样有界,systemd 停止
不再因断网挂起。
- `braid profile inspect` 明确标注 models.json 由 `llm_providers` 声明派生,
runtime home / template 标签收窄为 settings/agents 来源。

本版本不新增数据库 migration;配置 schema 保持 3。使用旧环境变量字段或
在 schema 3 的非 Pi Profile 上声明 provider 的配置会被明确拒绝;schema 2
Codex 配置中的旧 provider 标签及 LLM 协议/费用元数据仅作为惰性迁移字段读取。

## [Unreleased pre-0.3.3]

- 有限 run 的 Issue 指派保留真实执行输入,首次轮次前处理已有 Context reset;普通 serve 指派仍保持空闲会话合同。
- 受控 Pi background Bash 使用非登录 shell,原生入口移除 BASH_ENV/ENV,工具路径与缓存由实例明确提供。
- 内建协作的 Harness ledger 写命令先取得 IMMEDIATE 事务准入,纯读仍为 DEFERRED;绑定错误保留账本路径与 SQLite extended code。

- 新增与常驻 `serve` 并列的 `braid run`:从顶层 root Issue 或 description 驱动自主拆分、指派、PR 实现与交付,首版接入独立 built-in 平台。
- 平台原子保存父子 Issue,冻结 run/client/交付分支边界;范围关闭和 pending 授权撤销保留停止门控。Console 通过共享接口控制 run,支持原输入接续与独立终态展示。
- Harness schema 7 保存有限运行身份和结果,平台 schema 3 增加任务树与范围授权。配置 schema 保持 3,旧迁移不改写。

- 内建协作平台与 GitHub 作为 Harness 的同层上游。平台独立配置、schema、对象库
与 HTTP API,不再依赖 Harness 会话表或 `local` 运行模式。
- Web Console 属于整个 Braid,集成 OTLP 三信号原始证据与可视化,直接控制任一
上游的 Harness,并可便捷托管独立平台;停止 Harness 不关闭平台或 Collector。
- Harness 自存上游事件游标及写入授权。平台 grant、对象 revision、命令回执与
Git 候选意图保留并发和停止边界,过期执行不能继续发布。
- 配置 schema 3 使用互斥 `[github]` / `[builtin]`;原 GitHub schema 2 配置可继续
读取。旧 `[local]` 必须停止后显式导入平台,保留原对象身份、历史与回执。
- Harness 数据库 schema 6 曾增加接入状态,平台 schema 独立演进。旧迁移保持不可变,
新版本使用前须迁移,旧二进制不能读取更新后的 Harness 数据库。
- 修复输入接纳、首次 Context 持久化、完整错误保存与停止证明不足时的恢复门控。

## [0.3.2] - 2026-09-19

### Changed
Expand Down Expand Up @@ -334,6 +454,10 @@ Versioning once release artifacts are published.

## [Unreleased]

- 新增与常驻 `serve` 并列的 `braid run`:从顶层 root Issue 或 description 驱动自主拆分、指派、PR 实现与交付,首版接入独立 built-in 平台。
- 平台原子保存父子 Issue,冻结 run/client/交付分支边界;范围关闭和 pending 授权撤销保留停止门控。Console 通过共享接口控制 run,支持原输入接续与独立终态展示。
- Harness schema 7 保存有限运行身份和结果,平台 schema 3 增加任务树与范围授权。配置 schema 保持 3,旧迁移不改写。

### Changed

- Replaced the withdrawn Python turn-mirroring prototype with a Rust runtime
Expand Down
50 changes: 49 additions & 1 deletion Cargo.lock

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

6 changes: 5 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "braid"
version = "0.3.2"
version = "0.3.3"
edition = "2024"
rust-version = "1.93"
description = "GitHub working memory for local coding agents"
Expand All @@ -11,6 +11,7 @@ publish = false
[[bin]]
name = "braid"
path = "src/main.rs"
test = false

[dependencies]
anyhow = "1.0"
Expand All @@ -24,6 +25,9 @@ jsonwebtoken = { version = "10.4", features = ["use_pem"] }
opentelemetry = { version = "0.32", features = ["logs", "metrics", "trace"] }
opentelemetry-appender-tracing = "0.32"
opentelemetry-otlp = { version = "0.32", default-features = false, features = ["http-proto", "reqwest-blocking-client", "logs", "metrics", "trace"] }
opentelemetry-proto = { version = "0.32", default-features = false, features = ["gen-tonic-messages", "with-serde", "trace", "logs", "metrics"] }
prost = "0.14"
flate2 = "1.1"
opentelemetry_sdk = { version = "0.32", features = ["logs", "metrics", "trace"] }
rusqlite = { version = "0.40", features = ["backup", "bundled"] }
reqwest = { version = "0.13", default-features = false, features = ["blocking", "json", "rustls"] }
Expand Down
Loading
Loading