@buildr-ai/buildr 0.1.0-rc.6 → 0.1.0-rc.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +41 -7
- package/{tools/buildr → bin/buildr.mjs} +2 -2
- package/docs/cli-architecture.md +68 -40
- package/docs/cli-reference.md +28 -6
- package/docs/known-limitations.md +4 -2
- package/docs/skill-capability-contracts.md +6 -4
- package/package/README.md +29 -20
- package/package/bootstrap/contract.yml +1 -1
- package/package/bootstrap/guide.md +3 -3
- package/package/launchers/assets/Buildr.icns +0 -0
- package/package/launchers/assets/Buildr.ico +0 -0
- package/package/launchers/assets/buildr-icon.png +0 -0
- package/package/launchers/build.mjs +90 -0
- package/package/launchers/manage.mjs +119 -0
- package/package/manifest.yml +35 -26
- package/package/targets/runtime/skills/buildr/SKILL.md +13 -13
- package/package/targets/workspace/.buildr/workspace.yml +3 -2
- package/package/targets/workspace/components/buildr/openspec/component.yml +1 -1
- package/package/targets/workspace/components/buildr/openspec/contributions/openspec-propose-sidebar.md +8 -0
- package/package/targets/workspace/projects/manifest.yml +1 -1
- package/package/targets/workspace/projects/services/manifest.yml +2 -2
- package/package/targets/workspace/skills/buildr/git-ops/SKILL.md +2 -0
- package/package/targets/workspace/skills/buildr/task-asset-review/SKILL.md +146 -99
- package/package/targets/workspace/skills/buildr/task-asset-review/agents/openai.yaml +2 -2
- package/package/targets/workspace/skills/buildr/task-asset-review/scripts/observation.mjs +241 -0
- package/package/targets/workspace/skills/buildr/task-asset-review/templates/asset-maintenance-record.md +31 -0
- package/package/targets/workspace/skills/buildr/task-asset-review/templates/observation.md +30 -0
- package/package/targets/workspace/skills/buildr/task-finish/SKILL.md +27 -27
- package/package/targets/workspace/skills/buildr/task-triage/SKILL.md +35 -2
- package/package/targets/workspace/skills/buildr/task-verification/SKILL.md +58 -22
- package/package/targets/workspace/skills/buildr/task-verification/references/project-verification-v1.md +43 -0
- package/package/targets/workspace/skills/buildr/task-verification/templates/project-verification.yml +30 -0
- package/package/targets/workspace/skills/buildr/task-worktree/SKILL.md +15 -12
- package/package/targets/workspace/skills/contracts/buildr/git-task-integration/v1.md +3 -3
- package/package/targets/workspace/skills/contracts/buildr/task-asset-review/v1.md +1 -1
- package/package/targets/workspace/skills/contracts/buildr/task-asset-review/v2.md +35 -0
- package/package/targets/workspace/skills/contracts/buildr/task-finish/v1.md +5 -5
- package/package/targets/workspace/skills/contracts/buildr/task-verification/v2.md +45 -0
- package/package/targets/workspace/skills/contracts/buildr/task-worktree-lifecycle/v2.md +37 -0
- package/package/targets/workspace/skills/manifest.yml +19 -19
- package/package.json +24 -27
- package/src/application/change/change-application.mjs +234 -0
- package/{tools/cli → src}/application/cli-update.mjs +18 -4
- package/src/application/compose-runtime.mjs +58 -0
- package/{tools/cli → src}/application/doctor/capability-diagnostics.mjs +1 -1
- package/src/application/doctor/project-verification-diagnostics.mjs +221 -0
- package/{tools/cli → src}/application/doctor/scope-diagnostics.mjs +65 -28
- package/{tools/cli → src}/application/doctor/service-diagnostics.mjs +27 -1
- package/{tools/cli → src}/application/doctor.mjs +15 -6
- package/{tools/cli → src/application}/domains/commands.mjs +5 -2
- package/{tools/cli → src/application}/domains/components.mjs +10 -13
- package/{tools/cli → src/application}/domains/openspec.mjs +9 -10
- package/{tools/cli → src/application}/domains/package-assets.mjs +77 -38
- package/{tools/cli → src/application}/domains/rules.mjs +3 -1
- package/{tools/cli → src/application}/domains/runtime.mjs +7 -8
- package/{tools/cli → src/application}/domains/skills.mjs +7 -3
- package/{tools/cli → src/application}/domains/workspace.mjs +120 -52
- package/{tools/cli/shared → src/application}/json-contracts.mjs +4 -0
- package/{tools/cli → src}/application/package-maintenance/builtin-lifecycle.mjs +2 -2
- package/{tools/cli → src}/application/package-maintenance/output.mjs +1 -1
- package/{tools/cli → src}/application/package-maintenance/smoke-checks.mjs +19 -18
- package/{tools/cli → src}/application/package-maintenance/static-validation.mjs +96 -59
- package/{tools/cli → src}/application/package-maintenance.mjs +13 -18
- package/src/application/project/project-application.mjs +200 -0
- package/{tools/cli → src}/application/runtime.mjs +26 -17
- package/src/application/service/service-application.mjs +152 -0
- package/src/application/workspace/workspace-application.mjs +518 -0
- package/{tools/cli → src}/application/workspace-operations.mjs +35 -8
- package/src/application/worktree/worktree-application.mjs +615 -0
- package/src/domain/project/project.mjs +60 -0
- package/src/domain/service/service.mjs +57 -0
- package/src/domain/workspace/workspace.mjs +21 -0
- package/{tools/cli/shared/infrastructure.mjs → src/infrastructure/filesystem/index.mjs} +10 -13
- package/src/infrastructure/filesystem/project-manifest-repository.mjs +144 -0
- package/src/infrastructure/filesystem/service-manifest-repository.mjs +133 -0
- package/src/infrastructure/filesystem/workspace-manifest-repository.mjs +148 -0
- package/src/infrastructure/filesystem/workspace-registry-repository.mjs +102 -0
- package/src/infrastructure/git/project-git-observer.mjs +44 -0
- package/{tools/cli/shared → src/infrastructure}/platform.mjs +15 -18
- package/src/infrastructure/process.mjs +1 -0
- package/src/infrastructure/product-layout.mjs +11 -0
- package/{tools → src/infrastructure}/runtime/adapter-contract.mjs +29 -0
- package/{tools → src/infrastructure}/runtime/check-claude-code.mjs +1 -1
- package/{tools → src/infrastructure}/runtime/check-codex.mjs +1 -1
- package/{tools → src/infrastructure}/runtime/render-claude-code-rules.mjs +1 -1
- package/{tools → src/infrastructure}/runtime/render-claude-code.mjs +2 -2
- package/{tools → src/infrastructure}/runtime/skills/arguments.mjs +2 -2
- package/{tools → src/infrastructure}/runtime/skills/primitives.mjs +1 -1
- package/{tools → src/infrastructure}/runtime/skills/sources.mjs +1 -1
- package/{tools/cli/command → src/interfaces/cli}/diagnostics.mjs +1 -1
- package/{tools/cli/command → src/interfaces/cli}/help.mjs +104 -10
- package/{tools/cli/command → src/interfaces/cli}/identity.mjs +1 -1
- package/src/interfaces/cli/launcher.mjs +20 -0
- package/{tools/cli/bootstrap.mjs → src/interfaces/cli/main.mjs} +1 -1
- package/{tools/cli/command → src/interfaces/cli}/registry.mjs +15 -1
- package/src/interfaces/local-app/http/server.mjs +414 -0
- package/src/interfaces/local-app/runtime/directory-picker.mjs +32 -0
- package/src/interfaces/local-app/runtime/instance-manager.mjs +116 -0
- package/src/interfaces/local-app/runtime/preview-manager.mjs +231 -0
- package/src/interfaces/local-app/web/api-client.js +31 -0
- package/src/interfaces/local-app/web/app.js +200 -0
- package/src/interfaces/local-app/web/features/agent-actions.js +161 -0
- package/src/interfaces/local-app/web/features/change-detail.js +29 -0
- package/src/interfaces/local-app/web/features/changes.js +67 -0
- package/src/interfaces/local-app/web/features/project-detail.js +27 -0
- package/src/interfaces/local-app/web/features/project-edit.js +13 -0
- package/src/interfaces/local-app/web/features/projects.js +84 -0
- package/src/interfaces/local-app/web/features/service-detail.js +26 -0
- package/src/interfaces/local-app/web/features/service-edit.js +14 -0
- package/src/interfaces/local-app/web/features/services.js +91 -0
- package/src/interfaces/local-app/web/features/workspace.js +62 -0
- package/src/interfaces/local-app/web/features/workspaces.js +87 -0
- package/src/interfaces/local-app/web/index.html +71 -0
- package/src/interfaces/local-app/web/router.js +32 -0
- package/src/interfaces/local-app/web/styles.css +275 -0
- package/package/targets/workspace/skills/contracts/buildr/task-verification/v1.md +0 -35
- package/package/targets/workspace/skills/contracts/buildr/task-worktree-lifecycle/v1.md +0 -35
- package/tools/cli/application/compose-runtime.mjs +0 -38
- package/tools/cli/application/release/bridge-main-to-dev.mjs +0 -152
- package/tools/verification/integrity/managed-data-integrity.mjs +0 -193
- package/tools/verification/integrity/managed-mutations.mjs +0 -72
- package/tools/verification/openspec/contract.mjs +0 -212
- package/tools/verification/runtime/adapter-contract.mjs +0 -281
- package/tools/verification/runtime/adapter-parity.mjs +0 -298
- /package/{tools/cli → src}/application/doctor/result-model.mjs +0 -0
- /package/{tools/cli → src}/application/doctor/runtime-diagnostics.mjs +0 -0
- /package/{tools/cli → src}/application/package-maintenance/builtin-receipts.mjs +0 -0
- /package/{tools/cli → src}/application/package-maintenance/builtin-replacement.mjs +0 -0
- /package/{tools/cli → src}/application/package-maintenance/sync-plan.mjs +0 -0
- /package/{tools/cli → src}/application/package-maintenance/verification-registry.mjs +0 -0
- /package/{tools/shared → src/infrastructure/network}/fetch-remote-text.mjs +0 -0
- /package/{tools → src/infrastructure}/runtime/check-runtime.mjs +0 -0
- /package/{tools → src/infrastructure}/runtime/projection.mjs +0 -0
- /package/{tools → src/infrastructure}/runtime/skills/capabilities.mjs +0 -0
- /package/{tools → src/infrastructure}/runtime/skills/contributions.mjs +0 -0
- /package/{tools → src/infrastructure}/runtime/skills/inventory.mjs +0 -0
- /package/{tools → src/infrastructure}/runtime/skills/manifests.mjs +0 -0
- /package/{tools → src/infrastructure}/runtime/skills/projection-files.mjs +0 -0
- /package/{tools → src/infrastructure}/runtime/skills/publication.mjs +0 -0
- /package/{tools → src/infrastructure}/runtime/skills/render-plan.mjs +0 -0
package/README.md
CHANGED
|
@@ -2,22 +2,56 @@
|
|
|
2
2
|
|
|
3
3
|
中文 | [English](https://github.com/elevenching/Buildr/blob/main/README.en.md)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## 让 Agent 接着已有积累,把工作持续推进下去
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
当项目背景散在聊天、人的经验和多个代码仓里,Agent 每换一次任务或工具就得重新理解;团队做过的判断、流程和项目关系也很难继续复用。Buildr 把这些工作事实和工作方法组织成 Agent 可持续使用的工作资产。
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
你可以用 Buildr:组织现有业务与代码仓、让 Agent 基于项目事实继续一项长期工作、把验证过的工作方法沉淀下来,或在更换 Agent 后继续使用同一套资产。Buildr 不取代 Agent 的理解、规划和专业执行;它让这些工作有可发现、可诊断、可交接的基础。
|
|
10
|
+
|
|
11
|
+
## 快速开始:先完成第一项真实工作
|
|
12
|
+
|
|
13
|
+
把下面这句话交给你正在使用的 Agent:
|
|
14
|
+
|
|
15
|
+
```text
|
|
16
|
+
帮我开始使用 Buildr:检查并安装需要的 Buildr,确认或创建当前 Workspace;用普通语言引导我建立 Project,并只在有代码仓、应用、模块或可执行资产时接入 Service;完成必要的初始化和验证后,问我第一项想推进的真实工作。
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Agent 会负责 runtime discovery、初始化、doctor 和必要的确定性操作。你的第一次成功不是“已经输入过 init 命令”,而是:你已确认 Workspace、Project、可选 Service,并能直接向 Agent 描述要推进的目标。
|
|
20
|
+
|
|
21
|
+
也可以打开本机 Buildr App:添加已有 Workspace,查看当前 Project 与 Service 范围,然后点击“用 Agent 开始”。App 只帮助理解范围、维护低风险 metadata 和生成交接指令;它不创建 repo、不迁移资产,也不在页面内执行任务。
|
|
22
|
+
|
|
23
|
+
### 只需理解三个对象
|
|
24
|
+
|
|
25
|
+
```text
|
|
26
|
+
Workspace → Project → Service(可选)
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
- **Workspace**:你和 Agent 共同工作的顶层目录。
|
|
30
|
+
- **Project**:一个业务、产品、系统或长期工作单元。
|
|
31
|
+
- **Service**:该 Project 按需管理的代码仓、应用、模块或可执行资产;没有 Service 也可以开始 Project 范围工作。
|
|
32
|
+
|
|
33
|
+
## Agent 与 local app 各做什么
|
|
34
|
+
|
|
35
|
+
Agent 负责理解目标、读取相关资产、规划、执行和验证。local app 负责让人看懂真实的 Workspace / Project / Service 范围,受控维护名称与说明,并把 canonical 范围和目标交给 Agent。两条入口读取同一份 Workspace 源资产,不维护第二套 onboarding 状态。
|
|
36
|
+
|
|
37
|
+
## 手动或技术兜底
|
|
38
|
+
|
|
39
|
+
当 Agent 无法执行时,再使用下面的确定性入口。Buildr 需要 Node.js 20+:
|
|
10
40
|
|
|
11
41
|
```bash
|
|
12
42
|
npm install --global @buildr-ai/buildr@next
|
|
13
43
|
buildr runtime list --json
|
|
14
44
|
buildr init --agent <agent> --target . --name <name> --profile <personal|team|company>
|
|
45
|
+
buildr app --target .
|
|
15
46
|
```
|
|
16
47
|
|
|
17
|
-
|
|
48
|
+
`init --agent` 以最终 doctor 为技术 onboarding 证据;成功后仍应由 Agent 根据真实 Project/Service 状态完成简短交接。深入命令和 runtime 细节见 [CLI Reference](docs/cli-reference.md) 与 [Runtime Adapters](docs/agent-runtime-adapters.md)。
|
|
18
49
|
|
|
19
|
-
|
|
50
|
+
## 当前能力与边界
|
|
20
51
|
|
|
21
|
-
|
|
52
|
+
- 一个 Workspace 可管理多个 Project;每个 Project 可按需管理多个 Service。
|
|
53
|
+
- Rules、Skills、Components、Commands、OpenSpec 和 Project/Service 资产可作为长期工作资产治理。
|
|
54
|
+
- 支持 claude-code、codex、cursor、qoder、trae、trae-work、workbuddy 等 runtime adapter。
|
|
55
|
+
- 当前不提供远程 SaaS、Agent session connector、聊天客户端或自动专业任务执行。
|
|
22
56
|
|
|
23
|
-
|
|
57
|
+
完整产品定位和边界见 [Buildr Product](../../docs/buildr-product.md),已知限制见 [Known Limitations](docs/known-limitations.md)。
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
import process from 'node:process';
|
|
4
|
-
import { runCli } from '
|
|
4
|
+
import { runCli } from '../src/interfaces/cli/main.mjs';
|
|
5
5
|
|
|
6
6
|
try {
|
|
7
|
-
runCli(process.argv);
|
|
7
|
+
await runCli(process.argv);
|
|
8
8
|
} catch (error) {
|
|
9
9
|
console.error(process.env.BUILDR_DEBUG_STACK === '1' && error.stack ? error.stack : error.message);
|
|
10
10
|
process.exit(1);
|
package/docs/cli-architecture.md
CHANGED
|
@@ -1,73 +1,101 @@
|
|
|
1
|
-
# Buildr
|
|
1
|
+
# Buildr Product 内部架构
|
|
2
2
|
|
|
3
|
-
本文面向 Buildr 维护者,说明
|
|
3
|
+
本文面向 Buildr 维护者,说明 Product 源码、CLI、Agent runtime、仓库验证与交付资产的边界。`src/` 是 npm package 的内部实现,不是公开 JavaScript API;公开兼容承诺仍以命令、参数、help、JSON schema、文件结果和 OpenSpec specs 为准。
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## 生命周期目录
|
|
6
6
|
|
|
7
7
|
```text
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
8
|
+
bin/ npm executable 薄入口
|
|
9
|
+
src/
|
|
10
|
+
domain/
|
|
11
|
+
workspace/ Workspace 实体、UUID 格式与纯字段约束
|
|
12
|
+
application/ 用例、跨模块组合和产品 verifier
|
|
13
|
+
domains/ 现有领域操作 handler;尚非纯领域模型
|
|
14
|
+
workspace/ Workspace 查询、修改、迁移和 prompt 用例
|
|
15
|
+
worktree/ Canonical task checkout 与创建后环境 bootstrap 用例
|
|
16
|
+
infrastructure/ filesystem、network、platform、Agent runtime adapters
|
|
17
|
+
filesystem/ Manifest repository、路径、YAML、revision 与 transaction primitive
|
|
18
|
+
interfaces/
|
|
19
|
+
cli/ CLI registry、help、参数与输出 adapter
|
|
20
|
+
local-app/ loopback HTTP 与离线 Workspace Web 页面
|
|
21
|
+
test/
|
|
22
|
+
unit/ 小粒度单元测试
|
|
23
|
+
contract/ 静态和公开契约测试
|
|
24
|
+
integration-*/ 分级集成测试
|
|
25
|
+
fixtures/ 测试样本
|
|
26
|
+
verification/ 仓库门禁、规划、执行和证据
|
|
27
|
+
scripts/ checkout 安装、卸载和验证入口
|
|
28
|
+
package/ Buildr 向 Workspace/runtime 交付的源资产
|
|
18
29
|
```
|
|
19
30
|
|
|
20
|
-
|
|
21
|
-
- `command/`:根/主题 help、唯一 command registry 和参数 dispatch。
|
|
22
|
-
- `application/`:组合 doctor、sync/update、package maintenance 等跨领域流程。
|
|
23
|
-
- `domains/`:Workspace/Project/Service、Rules、Skills、Commands、Components、OpenSpec contract 和 runtime 等领域实现。
|
|
24
|
-
- `shared/`:无领域语义的参数、路径、YAML、Git、filesystem、atomic write 和 workspace transaction 基础设施。
|
|
31
|
+
`bin/buildr.mjs` 只启动 `src/interfaces/cli/main.mjs`。Product 根 `buildr` 是 checkout convenience entry,也委托同一个 bin;npm 安装、checkout 执行与本机安装因此共享一套 implementation。
|
|
25
32
|
|
|
26
|
-
|
|
33
|
+
`src/application/domains/` 保留原有 Rules、Skills、Commands、Components、部分 workspace lifecycle、OpenSpec 和 runtime handler。Workspace、Project、Service 已完成垂直切片:`src/domain/<domain>/` 只表达实体、值对象和纯约束,`src/application/<domain>/` 持有用例,`src/infrastructure/filesystem/*-manifest-repository.mjs` 持有 YAML/path/revision,Git adapter 持有实时观察,`src/interfaces/local-app/` 持有 HTTP/Web。旧 lifecycle 只能逐步委托这些 Application,不得新增 interface 直接解析 manifest 的路径。
|
|
27
34
|
|
|
28
|
-
|
|
35
|
+
## 依赖方向与所有权
|
|
36
|
+
|
|
37
|
+
当前迁移接受以下依赖方向:
|
|
38
|
+
|
|
39
|
+
```text
|
|
40
|
+
bin -> interfaces -> application -> infrastructure
|
|
41
|
+
\--------------> domain(存在纯领域模型后)
|
|
42
|
+
infrastructure --------------------> domain
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
- `bin` 不包含业务逻辑。
|
|
46
|
+
- `interfaces` 负责协议适配,只调用应用用例,不被 application 或 infrastructure 反向依赖。
|
|
47
|
+
- `application` 组合产品行为;现阶段可调用明确命名的 infrastructure adapter。未来抽取纯 domain 时,domain 不得依赖 filesystem、process、runtime、CLI 或测试代码。
|
|
48
|
+
- `infrastructure` 持有 filesystem、network、进程/Git 和 Agent runtime 的具体实现。
|
|
49
|
+
- `src` 与 `bin` 不得导入 `test/` 或 `scripts/`。
|
|
50
|
+
|
|
51
|
+
不建立顶层或 `src/shared/`。复用代码按语义归属:文件和 transaction primitive 在 `infrastructure/filesystem`,子进程调用在 `infrastructure/process.mjs`,产品目录常量在 `infrastructure/product-layout.mjs`,远程读取在 `infrastructure/network`,Agent runtime 在 `infrastructure/runtime`,JSON contract 在 `application`,CLI registry/help/output 在 `interfaces/cli`。新增 helper 必须先确定 owner。
|
|
52
|
+
|
|
53
|
+
`infrastructure/platform.mjs` 只是一份供 `application/compose-runtime.mjs` 构造兼容 runtime object 的 composition dependency registry。普通模块必须直接导入 Node API、runtime adapter 或 product-layout owner;不得从 platform 聚合面取 named imports。待兼容 runtime object 被后续功能逐步拆除后,该 registry 也可删除。
|
|
54
|
+
|
|
55
|
+
三个稳定 facade 保留现有调用表面,但不承载无界长流程:
|
|
29
56
|
|
|
30
57
|
```text
|
|
31
58
|
application/doctor.mjs
|
|
32
59
|
-> application/doctor/{scope,service,runtime}-diagnostics.mjs
|
|
33
60
|
application/package-maintenance.mjs
|
|
34
61
|
-> application/package-maintenance/{verification-registry,static-validation,smoke-checks}.mjs
|
|
35
|
-
|
|
36
|
-
->
|
|
62
|
+
infrastructure/runtime/render-claude-code.mjs
|
|
63
|
+
-> infrastructure/runtime/skills/{arguments,manifests,contributions,sources,render-plan}.mjs
|
|
37
64
|
```
|
|
38
65
|
|
|
39
|
-
|
|
66
|
+
CLI command 只在 `src/interfaces/cli/registry.mjs` 登记一次。领域操作由 `src/application/compose-runtime.mjs` 装配;`buildr app` 的 HTTP interface 由 CLI interface 在同一 composition 边界注册,Application 不反向依赖 Interfaces。新增命令不得在入口直接实现 mutation,也不得建立第二份 registry。
|
|
40
67
|
|
|
41
|
-
|
|
68
|
+
## Product verifier 与仓库 verification
|
|
42
69
|
|
|
43
|
-
|
|
70
|
+
分类依据是安装后 CLI 的运行依赖,而不是文件名:
|
|
44
71
|
|
|
45
|
-
|
|
72
|
+
- `buildr package check` 可达的 static、workspace、Commands、Rules、Skills 和 runtime verifier 属于产品,位于 `src/application/package-maintenance/` 或明确的 infrastructure owner,并随 npm package 发布。
|
|
73
|
+
- 只服务 `npm test`、Fast、Changed、Focus、Candidate、coverage 或 CI 的 registry、planner、scheduler、runner、timing、evidence 和 focused verifier 位于 `test/verification/`,不进入 npm tarball。
|
|
74
|
+
- `scripts/verify-buildr-product*` 只是 checkout 入口,委托统一 verification registry,不复制 step、预算或依赖关系。
|
|
46
75
|
|
|
47
|
-
|
|
76
|
+
Workspace E2E 位于 `test/verification/workspace/`,保留 `workspace-lifecycle`、`ownership-recovery` 和 `runtime-reconciliation` 三条跨组件路径。其他 help、onboarding、runtime family parity、tarball inventory 与安装后生命周期由各自 focused verifier 持有。
|
|
48
77
|
|
|
49
|
-
|
|
78
|
+
验证 registry 是 step identity、executor、inputs、依赖、profile/group、预算、并发类别和 artifact metadata 的唯一规划事实源。planner 对未映射的 Product 路径 fail closed;Candidate 固定选择完整 profile,并只创建一个共享只读 tarball artifact。
|
|
50
79
|
|
|
51
|
-
##
|
|
80
|
+
## npm 与交付边界
|
|
52
81
|
|
|
53
|
-
- `
|
|
54
|
-
- `package.json#files`
|
|
55
|
-
-
|
|
56
|
-
- `
|
|
82
|
+
- `package.json#bin.buildr` 指向 `bin/buildr.mjs`。
|
|
83
|
+
- `package.json#files` 发布 `bin`、`src`、公开文档和顶层 `package`,不发布仓库测试、维护脚本、active changes 或 Workspace 私有资产。
|
|
84
|
+
- `package/` 只表示 init、sync、runtime 和 bootstrap 使用的交付源资产;它不是 npm 源码、构建脚本或测试 fixture 目录。
|
|
85
|
+
- 安装后的 `buildr package check` 必须只依赖 tarball 内的运行闭包。
|
|
86
|
+
- 内部路径不提供兼容承诺;重构仍不得改变公开 CLI 行为、JSON schema、文件结果或 transaction/fail-closed 语义。
|
|
57
87
|
|
|
58
88
|
## 维护验证
|
|
59
89
|
|
|
60
90
|
```bash
|
|
61
|
-
node
|
|
91
|
+
node test/verification/cli/architecture.mjs
|
|
62
92
|
npm test
|
|
63
93
|
npm run test:changed -- --plan
|
|
64
94
|
npm run test:focus -- group:cli
|
|
65
95
|
npm run test:focus -- group:runtime
|
|
66
|
-
node
|
|
67
|
-
node
|
|
68
|
-
node
|
|
96
|
+
node test/verification/cli/compatibility.mjs
|
|
97
|
+
node test/verification/cli/package-parity.mjs
|
|
98
|
+
node test/verification/integrity/managed-mutations.mjs
|
|
69
99
|
```
|
|
70
100
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
新增命令时应先在 `command/registry.mjs` 登记唯一 key,把领域逻辑放入对应 domain,并仅在确需跨领域组合时新增 application service。不要把领域 helper 放入 `shared/`,也不要通过 Component 或动态加载扩展 command registry。
|
|
101
|
+
架构 verifier 检查生命周期目录、薄入口、`src` import 方向、无 owner 的 shared、关键 facade、完整 runtime inventory、command 唯一登记、verification registry、Candidate required gates 和 npm 边界。mutation verifier 递归扫描全部发布 runtime module 的直接写入白名单;package parity 从 tarball 安装并比较 checkout/npm 行为。
|
package/docs/cli-reference.md
CHANGED
|
@@ -14,10 +14,13 @@
|
|
|
14
14
|
## 首次使用
|
|
15
15
|
|
|
16
16
|
```bash
|
|
17
|
+
buildr app launcher install --channel release --json
|
|
17
18
|
buildr runtime list --json
|
|
18
|
-
buildr init --agent <claude-code|codex|cursor|qoder|trae|trae-work|workbuddy> --target <workspace> --name <name> --profile <personal|team|company>
|
|
19
|
+
buildr init --agent <claude-code|codex|cursor|qoder|trae|trae-work|workbuddy> --target <workspace> --name <name> --description <description> --profile <personal|team|company>
|
|
19
20
|
```
|
|
20
21
|
|
|
22
|
+
用户要求 Agent“安装 Buildr”时,默认先安装 npm CLI,再安装当前平台 release launcher,并分别验证。`buildr app launcher install|status|uninstall` 只管理指定 launcher channel;macOS 默认安装到 `/Applications`,Windows 默认安装到当前用户的 LocalAppData Programs,`development` channel 安装为隔离的 `Buildr Dev`。全局安装不写 Agent runtime Skill;`init --agent` 在目标 Workspace 首次投射 Buildr Skill,`sync`/`render` 负责后续收敛。
|
|
23
|
+
|
|
21
24
|
`init --agent` 是默认首次 onboarding 入口:它先初始化源资产,再复用完整 `sync` 执行 source update、产品 Buildr Skill 安装、workspace destination 投射和最终 doctor。`init`/`sync` 不隐式写用户级 Skills。
|
|
22
25
|
|
|
23
26
|
`buildr update` 只更新 CLI 自身:开发 checkout 使用 Git 安全更新,registry package 使用 npm 更新。它不接收 `--target`,也不读取 workspace。用户要求“更新 Buildr”或“同步 Buildr”时,Agent 在 update 成功后重新解析入口,再执行 `buildr skill install <agent> --target <workspace>`,更新 CLI 与产品入口 Buildr Skill,而不扩大为 workspace sync。用户要求“更新 workspace”或“同步 workspace”时,Agent 先判断 workspace root 是否由 Git 管理:Git workspace 解析 `buildr.git-workspace-update/v1` binding 并使用 selected provider 检查当前分支、upstream 和工作区状态,成功后执行 `buildr sync <agent> --target <workspace>`;非 Git workspace 直接 sync。required provider blocked 或 Git 决策点会阻止后续 sync,Agent 不自动 stash、rebase 或覆盖;该复合意图不先更新 CLI,且 Git 更新成功后不重复询问 sync。`buildr sync` 自身不隐式执行 Git 更新。
|
|
@@ -27,8 +30,13 @@ buildr init --agent <claude-code|codex|cursor|qoder|trae|trae-work|workbuddy> --
|
|
|
27
30
|
| 命令 | 用途 |
|
|
28
31
|
|---|---|
|
|
29
32
|
| `buildr init [--agent <agent>]` | 初始化 Organization/Root;传入 `--agent` 时一次完成 runtime 与最终 doctor,不传时只写源资产。 |
|
|
30
|
-
| `buildr
|
|
31
|
-
| `buildr
|
|
33
|
+
| `buildr app [--target <workspace>] [--no-open]` | 启动或复用只监听 `127.0.0.1` 的默认本机 Web 应用;默认打开浏览器,登记和切换多个 Workspace,`--target` 登记并打开指定 Workspace。 |
|
|
34
|
+
| `buildr app preview start|list|stop` | Agent 为 task environment 启动、查看或停止隔离的开发预览;owner 绑定 task id、environment root、Product checkout 和 repository set,不替换默认应用或 `Buildr Dev.app`。 |
|
|
35
|
+
| `buildr app launcher install/status/uninstall` | 安装、诊断或卸载 release/development launcher;使用新 staging 验证后切换,保留 Workspace Registry 和源资产。 |
|
|
36
|
+
| `buildr project create <code>` | 创建或登记 Project;`--name`/`--description` 设置 metadata,`--repo`、`--remote`、`--integration-branch` 声明独立 Git source,并补齐空 `commands.yml` requirement context。 |
|
|
37
|
+
| `buildr service create <project>/<service> <repo-ref>` | 接入本地目录或 Git Service;用 `--name`、`--description`、`--type` 描述 Domain,Git 来源可用 `--remote`、`--integration-branch` 声明稳定来源。 |
|
|
38
|
+
| `buildr worktree create <task-id> --agent <agent> --branch <branch> [--include ...]` | 创建或幂等复用 `<workspace>/.worktrees/<task-id>`;默认根仓库,重复 `--include project:<code>` / `service:<project>/<service>` 加入 nested independent Git repositories。 |
|
|
39
|
+
| `buildr worktree inspect/context` | 按 receipt 检查完整 repository set,或判断实际 cwd 是否属于允许执行根;identity 或 membership 不匹配时 fail closed。 |
|
|
32
40
|
| `buildr rules add/remove` | 维护 root Rules manifest 和文件生命周期。 |
|
|
33
41
|
| `buildr skills add/remove` | 只维护 workspace `skills/` 中的 Skill source;旧 `--scope .` 仅兼容并警告,Project scope 被拒绝。 |
|
|
34
42
|
| `buildr skills bind/unbind` | 维护 workspace 默认 binding,或在 `projects/<project>/capabilities.yml` 维护 Project context binding。 |
|
|
@@ -40,7 +48,15 @@ buildr init --agent <claude-code|codex|cursor|qoder|trae|trae-work|workbuddy> --
|
|
|
40
48
|
| `buildr builtin list/uninstall/restore` | 查看或维护 Buildr 内置能力;required 能力不能卸载。`restore` 表示明确放弃该 Builtin 的本地修改;replacement 只接管可证明为 Buildr-managed 的 predecessor,恢复 source 后再运行 `sync <agent>` 收敛 runtime。 |
|
|
41
49
|
| `buildr update [check]` | 检查或更新 Buildr CLI 自身;不维护 workspace。 |
|
|
42
50
|
|
|
43
|
-
|
|
51
|
+
新 Workspace 使用 `.buildr/workspace.yml` 的 `buildr.workspace/v1` schema,并与 `skills/manifest.yml.workspaceId` 共享同一 UUID。旧 metadata 可以在 `buildr app` 中只读查看;`buildr sync <agent>` 通过同一 source transaction 显式迁移两份 Manifest,identity 冲突时零写入失败。页面修改使用 revision compare-and-swap,不自动覆盖 Agent、Git 或编辑器已经产生的外部变化。
|
|
52
|
+
|
|
53
|
+
默认 App 的用户级登记文件只保存规范化 Workspace root 和最近使用项;Workspace 名称、说明、Project、Service 与 Change 始终从各 Workspace 实时读取。Registry 为空时页面引导选择已有 Workspace、生成新建 Agent Action 或稍后处理,不自动扫描磁盘。关闭浏览器标签页不会停止本机服务,页面“退出 Buildr”会安全停止实例但保留登记列表和全部源资产。task worktree 的并发验收使用 `buildr app preview`:每个显式实例名拥有独立的状态目录、登记列表、启动锁和随机 loopback URL,并展示 worktree、分支、HEAD 与 dirty 身份。preview 直接运行请求 worktree 的 checkout,不安装或替换 `Buildr Dev.app`。macOS `Buildr.app` 与 Windows launcher bundle 携带运行所需的 Node runtime 和 Web 资源,只负责启动或复用默认随机 loopback 端口上的服务并打开默认浏览器,不提供 Desktop WebView。
|
|
54
|
+
|
|
55
|
+
Project registry 使用 `buildr.projects/v2`:每个 Project 保存 UUID `id`、所属 `workspaceId`、可读 `code`、`name`、`description` 和 `source`。`source.path` 是文件系统物化位置;Git source 另外保存 URL、remote 和稳定的 `integrationBranch`。`currentBranch`、HEAD、dirty、upstream 与 ahead/behind 是实时观察状态,不写入 Domain。v1 registry 可只读查询,`buildr sync <agent>` 显式迁移;页面不会静默迁移、切分支、stash 或改写 remote。
|
|
56
|
+
|
|
57
|
+
`service create --integration-branch` 只适用于 Git 来源,`--branch` 仅为兼容别名。Canonical Service Domain 保存 UUID `id`、`workspaceId`、`projectId`、`code`、`name`、`description`、`type` 和 `source`;`source.path` 定位文件系统中的实际 Service,Git source 保存 URL、remote 与稳定 integration branch。当前分支、HEAD、dirty、upstream 与 ahead/behind 只实时观察,不写回 Domain。
|
|
58
|
+
|
|
59
|
+
`worktree create` 要求 Agent 显式提供 task id、task branch、root start point、当前 Agent、workspace root 和完整 repository selectors。`buildr.worktree-create/v2` 返回 environment、repository plan、逐仓 identity/state、隔离披露和兼容的 root `worktree`/bootstrap 字段;相同 plan 幂等复用,不同 plan、occupied/tracked path、remote/branch ownership 或 identity 冲突均 fail closed。部分创建失败保留 receipt、checkout 和分支。Git working tree/index 被隔离,但 objects/refs 共享。外部依赖沿用 Project 既有环境;只有并发任务会修改同一共享状态时,才要求使用项目已有租户、测试账号、数据前缀或串行验证边界。
|
|
44
60
|
|
|
45
61
|
## Runtime 与诊断
|
|
46
62
|
|
|
@@ -56,7 +72,7 @@ buildr init --agent <claude-code|codex|cursor|qoder|trae|trae-work|workbuddy> --
|
|
|
56
72
|
|
|
57
73
|
`doctor` 的 `ok` 为兼容字段,只表示没有 error,不表示 workspace 已无需处理。Agent 应同时读取 `health.workspaceValid`、`health.ready`、`health.actionRequired` 和 `repairPlan`:例如只有 actionable warning 时,结果可以是 `ok: true` 但 `ready: false`。canonical workspace identity 要求根 `AGENTS.md`、`.buildr/workspace.yml` 和 `projects/` 同时存在;只存在其中一部分时报告 `incomplete`,不会误判为已初始化。
|
|
58
74
|
|
|
59
|
-
默认 doctor 分三层声明诊断边界:`core` 每次检查 workspace identity、mutation recovery 和 root registries;`conditional` 只在相关 scope、资产或 selected Agent 适用时检查 Project/Service、Rules/Skills、package assets、Commands 与 runtime;`specialty`
|
|
75
|
+
默认 doctor 分三层声明诊断边界:`core` 每次检查 workspace identity、mutation recovery 和 root registries;`conditional` 只在相关 scope、资产或 selected Agent 适用时检查 Project/Service、Rules/Skills、package assets、Commands 与 runtime;`specialty` 是显式场景。对已声明的独立 Git Project,doctor 会比较 remote、`integrationBranch` 和本地实时状态,但不会执行 Git 修改;它不深检 OpenSpec active change,也不运行 build/test。需要更多细节时进入对应 Git、OpenSpec、验证工作流。
|
|
60
76
|
|
|
61
77
|
当前支持 `claude-code`、`codex`、`cursor`、`qoder`、`trae`、`trae-work` 和 `workbuddy`。其他 runtime 不使用 fallback adapter;各 adapter 的文件路径、刷新方式和证据状态见 [Agent Runtime Adapters](agent-runtime-adapters.md)。
|
|
62
78
|
|
|
@@ -68,6 +84,12 @@ buildr init --agent <claude-code|codex|cursor|qoder|trae|trae-work|workbuddy> --
|
|
|
68
84
|
|
|
69
85
|
Buildr 不 render 或安装 Commands,不保存 binary、token、cookie、登录态、license 或个人配置。machine warning 只说明当前环境与有效 requirement 的差异;安装、升级或登录仍需要用户单独授权。
|
|
70
86
|
|
|
87
|
+
## Project 测试能力声明
|
|
88
|
+
|
|
89
|
+
`projects/<project>/verification.yml` 使用 `buildr.project-verification/v1`,可选声明任意测试能力的 argv、cwd、成熟度、Minimal/Affected/Candidate 阶段、门禁强度、适用路径、覆盖、环境、副作用、授权和依赖关系。它是 Project 测试事实,不是 `capabilities.yml` 中的 Skill binding,也不会被投射到 Service repo。
|
|
90
|
+
|
|
91
|
+
没有该文件时,doctor 不产生 finding,`task-verification` 继续从 AGENTS、POM、项目文档和已有测试入口发现政策。文件存在时 doctor 只做结构、路径和能力图校验,不运行命令或探测测试环境。用户通过 Agent 说“初始化测试声明”或“更新测试声明”即可生成/增量补充候选;新增能力默认 discovered 或 trial/advisory,不会自动成为 Candidate required gate。
|
|
92
|
+
|
|
71
93
|
## Skill capability contracts
|
|
72
94
|
|
|
73
95
|
`buildr.skills/v3` 为每个 workspace Skill 保存稳定 `assetIdentity`/`sourceIdentity`,并支持 versioned contract、provider `provides`、consumer `requires` 和 workspace 默认 binding。Project context 使用 `buildr.project-capabilities/v1`。安装 provider 本身不会静默改绑。
|
|
@@ -84,7 +106,7 @@ Contract 格式、scope 规则、替换示例以及 `ready` 的边界见 [Skill
|
|
|
84
106
|
|
|
85
107
|
## 内部实现边界
|
|
86
108
|
|
|
87
|
-
`
|
|
109
|
+
`bin/buildr.mjs` 是稳定 npm bin 路径,实际命令通过内部 `src/` runtime 和唯一 command registry 执行。该模块树随 tarball 发布以保证命令可运行,但不是公开 JavaScript API,不承诺文件级 import 兼容;维护约定见 [CLI 内部架构](cli-architecture.md)。
|
|
88
110
|
|
|
89
111
|
## 远端 Skill 请求
|
|
90
112
|
|
|
@@ -4,14 +4,16 @@
|
|
|
4
4
|
- TRAE Work 依赖桌面 Rules import toggle,WorkBuddy 依赖 `CODEBUDDY.md` 中的 imperative reference bridge;checker 报告 projection、environment probe 和 activation guidance,不把缺少真实 Agent marker smoke 作为当前 workspace 故障。Buildr 暂不维护品牌 smoke 状态或历史通过快照。
|
|
5
5
|
- runtime trait catalog 只降低新增 adapter 的重复实现;它不会把尚未独立验证五项 capabilities 的 Agent 自动视为 supported。
|
|
6
6
|
- CLI 支持 Node.js 20 及以上版本。CI 在 Linux 上对 Node 20/22 执行完整验证,并在 Linux、macOS、Windows 的 Node 22 上验证打包安装生命周期;其他 Node/操作系统组合不属于 0.1 的持续验证范围。
|
|
7
|
+
- Buildr Global App 当前仍是浏览器中的本机 Web 应用,不提供 Desktop WebView、菜单栏、登录启动、静默自动更新或系统通知。macOS 与 Windows launcher 只启动/复用随机 loopback 端口上的服务并打开默认浏览器;Linux 首批使用 CLI。官方签名、公证和 Windows SmartScreen 交付仍需在发布阶段单独启用与验证。
|
|
8
|
+
- App 不扫描磁盘或跨 Workspace 聚合资源;用户显式登记 root,关闭浏览器不等于退出,必须使用页面“退出 Buildr”或终止进程。
|
|
7
9
|
- Component 只支持 workspace scope;没有 Project/Service Component、远程 registry、依赖求解或可执行 Hook。
|
|
8
10
|
- Buildr 使用本地文件系统和 Git 保存资产,没有云端权限系统、Web UI 或跨机器自动恢复服务。
|
|
9
11
|
- Commands 只声明和诊断外部 CLI,不执行本机安装、升级或登录。
|
|
10
12
|
- 远端 Skill 当前只支持 raw `SKILL.md` 的 `resolved.kind: skill-url`;未声明 integrity 时允许 render,但 doctor 会警告。
|
|
11
13
|
- Agent 没有统一 API 枚举已加载的 admin/system/plugin Skills。adapter 会在 runtime scope 保留 `partial` inventory evidence,但不把不可观测性本身报告为健康 warning;Buildr 只检查自身管理候选的可观测同名项并阻止真实冲突,不盘点无关 runtime Skills,也不宣称已证明 Agent 全局唯一。首版不提供自动 adopt/transfer,外部资产必须重命名、显式移除/禁用或保持现场。
|
|
12
|
-
- `task-asset-review`
|
|
14
|
+
- `task-asset-review/v2` 依赖 Agent 在非简单任务中加载 Skill 并主动写入精炼 observation;没有 runtime Hook、daemon、watcher、事件总线或自动全量采集。它不读取隐藏推理,也不持久化完整对话、工具日志或逐节点任务轨迹。MVP 使用单任务 owner 与原子替换,不提供 CAS、复杂锁、数据库、全局索引或资产改名/拆分/合并历史。
|
|
13
15
|
- Service branch intent 不负责 pull、merge、rebase 或长期分支同步;它只控制首次 clone、metadata 和 drift 诊断。
|
|
14
|
-
- `@buildr-ai/buildr@0.1.0-rc.6`
|
|
16
|
+
- `@buildr-ai/buildr@0.1.0-rc.6` 是当前已发布 RC,`next` 指向该版本;`0.1.0-rc.7` 正在准备,尚未发布。`latest` 仍可能指向历史 prerelease,它不代表稳定版。稳定版 `0.1.0` 尚未发布,公开试用应显式安装 `@next`。`0.1.0-rc.4` 因发布范围错误已弃用。
|
|
15
17
|
- `package check/build` 与 `openspec baseline/check` 是维护/workflow 表面,不建议普通 workspace 直接依赖。
|
|
16
18
|
|
|
17
19
|
遇到 unsupported runtime 或不能确定的资产边界时,Agent 应停止自动变更、保留源资产,并报告可执行下一步。
|
|
@@ -80,11 +80,11 @@ bindings:
|
|
|
80
80
|
provider: git-ops
|
|
81
81
|
```
|
|
82
82
|
|
|
83
|
-
这里 `task-finish` 没有声明“调用 `git-ops`”或“调用 `task-verification`”。它只声明:缺少 `buildr.task-verification/
|
|
83
|
+
这里 `task-finish` 没有声明“调用 `git-ops`”或“调用 `task-verification`”。它只声明:缺少 `buildr.task-verification/v2` 返回的 `requiredAssurance`、匹配 identity、状态与真实耗时证据,或缺少 `buildr.git-task-integration/v1` 的最低保证和结果证据时,完整收尾不能安全继续。
|
|
84
84
|
|
|
85
|
-
任务验证单独建模,是因为它既可以在 task
|
|
85
|
+
任务验证单独建模,是因为它既可以在 task environment 中执行,也可以在当前分支、无 Git 项目或非代码候选中执行。`buildr.task-worktree-lifecycle/v2` 保护单仓或多仓 repository plan、checkout placement、execution roots、retention 与 cleanup;`buildr.task-verification/v2` 保护可选 Project 测试声明与 legacy policy 解析、affected/candidate 正式保证、完整 repository candidate identity、wall-clock、用户报告和落盘 evidence 生命周期。Project `verification.yml` 是测试能力事实,不是 Skill provider/binding,因此不进入 `capabilities.yml`。没有声明时 contract 保证零配置 legacy 行为;声明存在时 provider 按成熟度、阶段、环境、副作用和授权返回能力选择证据。验证 provider 负责 transient evidence 的安全删除实现,Task Finish 只决定 consumer 已使用完毕的时点;worktree provider 不清理与 checkout 无关的证据。两者互不要求固定 provider identity。
|
|
86
86
|
|
|
87
|
-
顶层验证 provider
|
|
87
|
+
顶层验证 provider 不是只有用户主动说“验证”才加载。用户直接要求测试、耗时报告、初始化/更新测试声明或推进测试能力成熟度时由 description 发现;实现任务到达验证节点、Agent 准备声称完成时由适用 Rule 的完成边界触发;Task Finish 则在“收尾”入口加载后通过 required binding 调用 selected provider。binding 选择 provider,但不会替代这些意图发现和完成边界。
|
|
88
88
|
|
|
89
89
|
### 3. Resolver 与 readiness
|
|
90
90
|
|
|
@@ -98,7 +98,9 @@ render/sync 会在 `task-finish` 的 runtime 派生版本中注入受管 binding
|
|
|
98
98
|
|
|
99
99
|
当用户说“收尾”时,Agent runtime 先根据 description 命中并加载 `task-finish`;这一步不经过产品入口 Buildr Skill。`task-finish` 随后读取受管 binding block,执行相应阶段前再读取已解析 contract 和 selected provider。Agent 根据当前仓库、授权和 candidate identity 执行专业动作,并把各 provider 返回的最小 evidence 交还给收尾编排;Git provider 不执行 Candidate 验证,worktree provider 不监控普通内容编辑,验证 provider/consumer 决定继续、复用、重验或停止。这个过程是 Agent 调解的工作协作,不是 `task-finish.gitOps()` 一类方法调用。
|
|
100
100
|
|
|
101
|
-
对 `buildr.task-verification/
|
|
101
|
+
对 `buildr.task-verification/v2`,调用 provider 还必须携带 operation、任务/change、发布意图、风险信号、变更路径、候选 identity 与已有 evidence。`inspect` 只核对已有 evidence,`execute` 才启动验证,`cleanup` 只处理已消费 evidence。provider 返回 `requiredAssurance: affected | candidate`;Task Finish 只核对 evidence 是否满足该保证。实现内容变化时重新执行同一 required assurance,不机械升级为 Candidate。`same-content` 或可归因 `closeout-metadata-only` transition 使用 `inspect`,两个 executor 调用计数均为 0。
|
|
102
|
+
|
|
103
|
+
对 optional `buildr.task-asset-review/v2`,provider 从非简单 Workspace 任务期间开始维护用户级 observation,并独占信号筛选、资格审查、人工决定和新任务交接政策。Task Finish consumer 只传递 Workspace/task identity 与最终证据引用并触发 finalize;它不复制 provider 的门禁。v2 允许写当前 owner 的本地 observation,因此不能用只读 v1 contract 替代。
|
|
102
104
|
|
|
103
105
|
### 6. 用户替换实现
|
|
104
106
|
|
package/package/README.md
CHANGED
|
@@ -1,31 +1,40 @@
|
|
|
1
|
-
# Buildr
|
|
1
|
+
# Buildr
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
中文 | [English](https://github.com/elevenching/Buildr/blob/main/README.en.md)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Buildr helps Agents keep building on organized work facts and work methods instead of repeatedly reconstructing project context from chats, personal experience, and disconnected repositories. It is useful for organizing an existing business and its repositories, continuing long-running work through an Agent, preserving reusable methods, and switching Agents without abandoning accumulated assets.
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Start with one real task
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
- 产品仓中的 `openspec/specs/buildr-package-assets/spec.md` 是随包资产和 package check 的规范性契约。
|
|
11
|
-
- 产品仓中的 `docs/release-checklist.md` 是发布和验证入口。
|
|
12
|
-
- `targets/workspace/` 保存由 init/sync 物化到用户 workspace 或 Project 的交付源。
|
|
13
|
-
- `targets/runtime/` 保存直接安装到 Agent runtime 的交付源;产品入口 Buildr Skill 位于 `targets/runtime/skills/buildr/SKILL.md`。
|
|
14
|
-
- `bootstrap/guide.md` 是 Buildr Skill 不可用时由 CLI 输出的 fallback runbook,`bootstrap/contract.yml` 是对应机器校验契约;bootstrap 不属于 workspace/runtime target。
|
|
9
|
+
Give your Agent this instruction:
|
|
15
10
|
|
|
16
|
-
|
|
11
|
+
```text
|
|
12
|
+
Help me start using Buildr: check and install what is needed, confirm or create the current Workspace, guide me to create a Project in plain language, attach a Service only when I have a repository, application, module, or executable asset, verify the necessary setup, then ask what real work I want to do first.
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
The first success is not merely running `init`. It is confirming a Workspace, a Project, an optional Service, and then giving the Agent a real goal.
|
|
16
|
+
|
|
17
|
+
The local Buildr App offers the same path visually: add an existing Workspace, understand the Project and optional Service scope, and choose **Start with Agent**. It only explains scope, maintains low-risk metadata, and creates a constrained handoff prompt. It does not create repositories, migrate assets, or execute professional work.
|
|
18
|
+
|
|
19
|
+
```text
|
|
20
|
+
Workspace → Project → Service (optional)
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
- **Workspace**: the top-level directory shared by you and an Agent.
|
|
24
|
+
- **Project**: a business, product, system, or long-lived work unit.
|
|
25
|
+
- **Service**: an optional repository, application, module, or executable asset in a Project.
|
|
26
|
+
|
|
27
|
+
## Manual fallback
|
|
17
28
|
|
|
18
|
-
|
|
29
|
+
When an Agent cannot perform setup, Buildr requires Node.js 20+:
|
|
19
30
|
|
|
20
31
|
```bash
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
(cd projects/product && npm run test:focus -- workspace-lifecycle ownership-recovery runtime-reconciliation)
|
|
26
|
-
(cd projects/product && openspec validate --all --strict)
|
|
32
|
+
npm install --global @buildr-ai/buildr@next
|
|
33
|
+
buildr runtime list --json
|
|
34
|
+
buildr init --agent <agent> --target . --name <name> --profile <personal|team|company>
|
|
35
|
+
buildr app --target .
|
|
27
36
|
```
|
|
28
37
|
|
|
29
|
-
|
|
38
|
+
`init --agent` uses the final doctor result as technical onboarding evidence; the Agent should then complete a brief first-use handoff from the real Project and Service state.
|
|
30
39
|
|
|
31
|
-
|
|
40
|
+
Buildr does not replace an Agent's reasoning, planning, or professional execution. It organizes durable work assets and provides deterministic tools and diagnostics. See the repository [README](https://github.com/elevenching/Buildr#readme), [Buildr Product](https://github.com/elevenching/Buildr/blob/main/projects/product/docs/buildr-product.md), [CLI Reference](https://github.com/elevenching/Buildr/blob/main/projects/product/services/buildr/docs/cli-reference.md), and [Runtime Adapters](https://github.com/elevenching/Buildr/blob/main/projects/product/services/buildr/docs/agent-runtime-adapters.md) for details.
|
|
@@ -101,7 +101,7 @@ buildrSkillRequiredText:
|
|
|
101
101
|
- capability-adaptation
|
|
102
102
|
- buildr.git-single-operation/v1
|
|
103
103
|
- buildr.git-workspace-update/v1
|
|
104
|
-
- buildr.task-verification/
|
|
104
|
+
- buildr.task-verification/v2
|
|
105
105
|
- components/manifest.yml
|
|
106
106
|
- buildr component install
|
|
107
107
|
- buildr component uninstall
|
|
@@ -16,6 +16,7 @@ workspace 尚未初始化时,用一个高层命令完成源资产、Buildr Ski
|
|
|
16
16
|
```bash
|
|
17
17
|
buildr init --agent <agent> --target <dir> --name <name> --profile <personal|team|company>
|
|
18
18
|
```
|
|
19
|
+
技术初始化完成后,不把 `project create` 命令直接交给用户。Agent 应读取最终 doctor 和真实 Workspace 状态,用普通语言完成一次首次使用交接:Workspace 是人和 Agent 共同工作的顶层目录;Project 是业务、产品、系统或长期工作;Service 只在需要代码仓、应用、模块或可执行资产时接入。没有 Project 时询问用户要长期管理什么;唯一 Project 没有 Service 时询问是接入已有资产还是直接开始 Project 范围工作;范围唯一时直接邀请用户描述第一项真实目标;有多个候选时只询问消除范围歧义所必需的问题。不要生成 `WELCOME.md`、持久 checklist 或固定教学 Rule。
|
|
19
20
|
已有 workspace 中,用户要求“更新 Buildr”或“同步 Buildr”时先更新 CLI,再用新入口安装最新产品入口 Buildr Skill,不同步整个 workspace:
|
|
20
21
|
|
|
21
22
|
```bash
|
|
@@ -23,7 +24,6 @@ buildr update
|
|
|
23
24
|
command -v buildr
|
|
24
25
|
buildr skill install <agent> --target <workspace-root>
|
|
25
26
|
```
|
|
26
|
-
|
|
27
27
|
用户要求“更新 workspace”或“同步 workspace”时,先确认 workspace root 是否由 Git 管理。Git 管理的 workspace 解析 `buildr.git-workspace-update/v1` binding,读取 selected provider 后检查当前分支、upstream 和工作区状态并安全更新本地 checkout;required provider blocked 或遇到本地改动、分叉、冲突、缺少 upstream 等决策点时停止说明,不自动 stash、rebase、覆盖,也不继续 sync。Git 更新成功后不重复询问 sync;非 Git workspace 跳过 Git provider。然后使用当前 CLI 执行 sync,不先更新 CLI;这不是 `buildr sync` 的隐式 Git 行为:
|
|
28
28
|
|
|
29
29
|
```bash
|
|
@@ -51,10 +51,10 @@ buildr doctor --agent <agent> --target <dir> --json
|
|
|
51
51
|
|
|
52
52
|
```bash
|
|
53
53
|
buildr project create <project> --target <dir> [--repo <git-url>] [--title <text>] [--description <text>]
|
|
54
|
-
buildr service create <project>/<service> <repo-ref> --target <dir>
|
|
54
|
+
buildr service create <project>/<service> <repo-ref> --target <dir> --name <name> --description <description> --type <type> [--remote <name>] [--integration-branch <branch>]
|
|
55
55
|
```
|
|
56
56
|
|
|
57
|
-
用户要管理业务、产品线、系统或长期工作单元时才创建 Project;Project 资产 repo 用 `project create --repo` clone 到 `projects/<project>/`,不登记外部本地链接。用户提供 service repo 路径、Git URL 或明确要接入服务资产时才创建 Service;Git
|
|
57
|
+
用户要管理业务、产品线、系统或长期工作单元时才创建 Project;Project 资产 repo 用 `project create --repo` clone 到 `projects/<project>/`,不登记外部本地链接。用户提供 service repo 路径、Git URL 或明确要接入服务资产时才创建 Service。Service Domain 使用 UUID、workspaceId、projectId、code、name、description、type 与 source;Git 来源用 `--integration-branch` 保存稳定集成目标,当前 checkout 只观察。Service 规则入口是 Service 目录中的 `AGENTS.md`,不通过 registry 参数指定规则路径。
|
|
58
58
|
|
|
59
59
|
## 边界
|
|
60
60
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import fs from 'node:fs';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import process from 'node:process';
|
|
5
|
+
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
6
|
+
|
|
7
|
+
const PRODUCT_ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../..');
|
|
8
|
+
const ASSET_ROOT = path.join(PRODUCT_ROOT, 'package', 'launchers', 'assets');
|
|
9
|
+
|
|
10
|
+
function option(args, name, fallback = null) {
|
|
11
|
+
const index = args.indexOf(name);
|
|
12
|
+
if (index === -1) return fallback;
|
|
13
|
+
const value = args[index + 1];
|
|
14
|
+
if (!value || value.startsWith('--')) throw new Error(`Missing value for ${name}`);
|
|
15
|
+
return value;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function copyApplication(target) {
|
|
19
|
+
fs.mkdirSync(target, { recursive: true });
|
|
20
|
+
for (const item of ['bin', 'src', 'package', 'package.json', 'LICENSE']) fs.cpSync(path.join(PRODUCT_ROOT, item), path.join(target, item), { recursive: true });
|
|
21
|
+
const modules = path.join(target, 'node_modules');
|
|
22
|
+
fs.mkdirSync(modules, { recursive: true });
|
|
23
|
+
fs.cpSync(path.join(PRODUCT_ROOT, 'node_modules', 'yaml'), path.join(modules, 'yaml'), { recursive: true });
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function assertFreshOutput(output) {
|
|
27
|
+
if (!fs.existsSync(output)) return;
|
|
28
|
+
if (fs.readdirSync(output).length > 0) throw new Error(`Launcher staging output must be new or empty: ${output}`);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function writeIdentity(file, identity) {
|
|
32
|
+
fs.writeFileSync(file, `${JSON.stringify(identity, null, 2)}\n`);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function buildMac(output, runtime, identity) {
|
|
36
|
+
const appName = identity.channel === 'development' ? 'Buildr Dev' : 'Buildr';
|
|
37
|
+
const root = path.join(output, `${appName}.app`, 'Contents');
|
|
38
|
+
const executableRoot = path.join(root, 'MacOS');
|
|
39
|
+
const resources = path.join(root, 'Resources');
|
|
40
|
+
fs.mkdirSync(executableRoot, { recursive: true });
|
|
41
|
+
fs.mkdirSync(resources, { recursive: true });
|
|
42
|
+
fs.copyFileSync(runtime, path.join(executableRoot, 'node'));
|
|
43
|
+
fs.chmodSync(path.join(executableRoot, 'node'), 0o755);
|
|
44
|
+
fs.copyFileSync(path.join(ASSET_ROOT, 'Buildr.icns'), path.join(resources, 'Buildr.icns'));
|
|
45
|
+
copyApplication(path.join(resources, 'buildr'));
|
|
46
|
+
writeIdentity(path.join(resources, 'launcher-identity.json'), identity);
|
|
47
|
+
fs.writeFileSync(path.join(executableRoot, 'Buildr'), `#!/bin/sh\nHERE=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)\nIDENTITY="$HERE/../Resources/launcher-identity.json"\nLOG_DIR="\${HOME}/Library/Logs/Buildr"\nLOG_FILE="$LOG_DIR/launcher.log"\nmkdir -p "$LOG_DIR"\n# This bundle is a launcher, not the long-running Web application itself.\n# Return control to LaunchServices after spawning the local server; otherwise\n# Finder considers the shell process to be an unresponsive App.\nBUILDR_LAUNCHER_IDENTITY="$IDENTITY" /usr/bin/nohup "$HERE/node" "$HERE/../Resources/buildr/bin/buildr.mjs" app >"$LOG_FILE" 2>&1 &\nexit 0\n`, { mode: 0o755 });
|
|
48
|
+
fs.writeFileSync(path.join(root, 'Info.plist'), `<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">\n<plist version="1.0"><dict><key>CFBundleName</key><string>${appName}</string><key>CFBundleDisplayName</key><string>${appName}</string><key>CFBundleIdentifier</key><string>${identity.channel === 'development' ? 'ai.buildr.local-app.dev' : 'ai.buildr.local-app'}</string><key>CFBundleShortVersionString</key><string>${identity.version}</string><key>CFBundleVersion</key><string>${identity.buildNumber}</string><key>CFBundlePackageType</key><string>APPL</string><key>CFBundleExecutable</key><string>Buildr</string><key>CFBundleIconFile</key><string>Buildr.icns</string><key>LSUIElement</key><true/></dict></plist>\n`);
|
|
49
|
+
return path.dirname(root);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function buildWindows(output, runtime, identity) {
|
|
53
|
+
const appName = identity.channel === 'development' ? 'Buildr Dev' : 'Buildr';
|
|
54
|
+
const root = path.join(output, appName);
|
|
55
|
+
const runtimeRoot = path.join(root, 'runtime');
|
|
56
|
+
fs.mkdirSync(runtimeRoot, { recursive: true });
|
|
57
|
+
fs.copyFileSync(runtime, path.join(runtimeRoot, 'node.exe'));
|
|
58
|
+
fs.copyFileSync(path.join(ASSET_ROOT, 'Buildr.ico'), path.join(root, 'Buildr.ico'));
|
|
59
|
+
copyApplication(path.join(root, 'app'));
|
|
60
|
+
writeIdentity(path.join(root, 'launcher-identity.json'), identity);
|
|
61
|
+
fs.writeFileSync(path.join(root, 'Launch-Buildr.cmd'), `@echo off\nset "BUILDR_LAUNCHER_IDENTITY=%~dp0launcher-identity.json"\nif not exist "%LOCALAPPDATA%\\Buildr\\Logs" mkdir "%LOCALAPPDATA%\\Buildr\\Logs"\n"%~dp0runtime\\node.exe" "%~dp0app\\bin\\buildr.mjs" app >>"%LOCALAPPDATA%\\Buildr\\Logs\\launcher.log" 2>&1\nexit /b %ERRORLEVEL%\n`);
|
|
62
|
+
fs.writeFileSync(path.join(root, 'Buildr.vbs'), Buffer.from(`\uFEFFSet shell = CreateObject("WScript.Shell")\nbase = CreateObject("Scripting.FileSystemObject").GetParentFolderName(WScript.ScriptFullName)\ncommand = Chr(34) & base & "\\Launch-Buildr.cmd" & Chr(34)\nexitCode = shell.Run(command, 0, True)\nIf exitCode <> 0 Then\n MsgBox "Buildr 无法启动。请重新打开;如果仍然失败,请查看 %LOCALAPPDATA%\\Buildr\\Logs\\launcher.log。", 16, "Buildr"\nEnd If\n`, 'utf16le'));
|
|
63
|
+
fs.writeFileSync(path.join(root, 'Install-Buildr-Shortcuts.ps1'), `$ErrorActionPreference = "Stop"\n$root = Split-Path -Parent $MyInvocation.MyCommand.Path\n$start = Join-Path $env:APPDATA "Microsoft\\Windows\\Start Menu\\Programs"\n$folders = @($start)\nif ($args -contains "--desktop") { $folders += [Environment]::GetFolderPath("Desktop") }\n$shell = New-Object -ComObject WScript.Shell\nforeach ($folder in $folders) {\n $shortcut = $shell.CreateShortcut((Join-Path $folder "${appName}.lnk"))\n $shortcut.TargetPath = "$env:WINDIR\\System32\\wscript.exe"\n $shortcut.Arguments = '"' + (Join-Path $root "Buildr.vbs") + '"'\n $shortcut.WorkingDirectory = $root\n $shortcut.IconLocation = (Join-Path $root "Buildr.ico") + ",0"\n $shortcut.Description = "打开 Buildr 本机 Web 应用"\n $shortcut.Save()\n}\nWrite-Host "${appName} 已添加到开始菜单。"\n`);
|
|
64
|
+
fs.writeFileSync(path.join(root, 'Install Buildr.cmd'), `@echo off\npowershell.exe -NoProfile -ExecutionPolicy Bypass -File "%~dp0Install-Buildr-Shortcuts.ps1" %*\npause\n`);
|
|
65
|
+
return root;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export function buildLauncher({ platform = process.platform, output, runtime = process.execPath, identity }) {
|
|
69
|
+
if (!['darwin', 'win32'].includes(platform)) throw new Error(`Unsupported launcher platform: ${platform}`);
|
|
70
|
+
if (!fs.existsSync(runtime)) throw new Error(`Node runtime not found: ${runtime}`);
|
|
71
|
+
if (!identity || identity.schemaVersion !== 'buildr.launcher-identity/v1') throw new Error('Launcher identity is required.');
|
|
72
|
+
assertFreshOutput(output);
|
|
73
|
+
fs.mkdirSync(output, { recursive: true });
|
|
74
|
+
return platform === 'darwin' ? buildMac(output, runtime, identity) : buildWindows(output, runtime, identity);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
async function main(args = process.argv.slice(2)) {
|
|
78
|
+
const packageData = JSON.parse(fs.readFileSync(path.join(PRODUCT_ROOT, 'package.json'), 'utf8'));
|
|
79
|
+
const channel = option(args, '--channel', 'release');
|
|
80
|
+
const identity = {
|
|
81
|
+
schemaVersion: 'buildr.launcher-identity/v1', version: packageData.version, channel,
|
|
82
|
+
source: option(args, '--source', channel === 'development' ? 'checkout' : 'release'),
|
|
83
|
+
buildId: option(args, '--build-id', packageData.version), buildNumber: option(args, '--build-number', '1'),
|
|
84
|
+
protocolVersion: 1, platform: option(args, '--platform', process.platform), builtAt: new Date().toISOString(),
|
|
85
|
+
};
|
|
86
|
+
const output = path.resolve(option(args, '--output', path.join(PRODUCT_ROOT, 'dist', 'launcher', `${channel}-${identity.buildId}`)));
|
|
87
|
+
console.log(buildLauncher({ platform: identity.platform, output, runtime: path.resolve(option(args, '--runtime', process.execPath)), identity }));
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
if (import.meta.url === pathToFileURL(process.argv[1] || '').href) main().catch((error) => { console.error(error.message); process.exitCode = 1; });
|