@abelxiaoxing/cadence 1.4.0 → 1.5.0
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 +130 -8
- package/agents/design-explorer.md +17 -11
- package/agents/diagnosis-worker.md +9 -1
- package/agents/implementation-worker.md +3 -1
- package/config/plan-draft.example.json +122 -0
- package/config/plan-draft.multiple-tasks.example.json +345 -0
- package/config/plan-draft.quick.example.json +78 -0
- package/package.json +10 -4
- package/prompts/abel-design.md +101 -44
- package/prompts/abel-implement.md +9 -0
- package/src/activity-contracts.ts +82 -0
- package/src/candidate-artifact.ts +143 -0
- package/src/candidate-patch.ts +31 -11
- package/src/candidate-workspace.ts +74 -0
- package/src/change-contract-schema.ts +191 -0
- package/src/change-contract.ts +5 -0
- package/src/change-verification.ts +920 -0
- package/src/child-budget.ts +58 -0
- package/src/child-model.ts +142 -0
- package/src/child-session.ts +289 -326
- package/src/contracts.ts +200 -76
- package/src/delivery-compiler.ts +105 -120
- package/src/delivery-revision.ts +42 -0
- package/src/design-control.ts +113 -4
- package/src/design-diagnostics.ts +150 -0
- package/src/durable-contracts.ts +213 -0
- package/src/durable-workflow.ts +148 -3570
- package/src/evidence-draft.ts +122 -0
- package/src/execution-profile.ts +38 -0
- package/src/implement-graph.ts +3 -0
- package/src/implement-plan.ts +70 -0
- package/src/index.ts +59 -522
- package/src/isolation-backend.ts +62 -40
- package/src/model-source.ts +22 -0
- package/src/operator-cli-entry.mjs +24 -0
- package/src/operator-cli.mjs +1421 -0
- package/src/operator-tools.ts +249 -0
- package/src/package-candidate.ts +227 -0
- package/src/package-verification.ts +86 -8
- package/src/package-workflow.ts +291 -0
- package/src/packet-runtime.ts +27 -48
- package/src/parent-provider.ts +86 -198
- package/src/phase-execution.ts +2248 -0
- package/src/pi-adapter.ts +19 -0
- package/src/plan-draft-summary.ts +149 -0
- package/src/plan-draft.ts +493 -0
- package/src/single-task-draft.ts +142 -0
- package/src/subagent-activity.ts +32 -66
- package/src/submit-tool.ts +20 -59
- package/src/transport-budget.ts +52 -0
- package/src/verification-capability.ts +5 -3
- package/src/verification-diagnostics.ts +76 -0
- package/src/verification-environment-io.ts +280 -0
- package/src/verification-environment.ts +56 -154
- package/src/verification-scan.ts +64 -0
- package/src/worker-broker.ts +39 -57
- package/src/workflow-policy.ts +14 -53
- package/src/workflow-recovery-policy.ts +95 -0
- package/src/workflow-scheduling.ts +105 -0
- package/src/workflow-state-machine.ts +105 -497
- package/src/workflow-status.ts +384 -0
- package/src/workspace-io-entry.mjs +19 -1
- package/src/workspace-io-worker.mjs +275 -50
- package/src/workspace-io.ts +6 -1
- package/src/empty-resource-loader.ts +0 -38
- package/src/parent-payload-bridge.ts +0 -523
package/README.md
CHANGED
|
@@ -3,6 +3,73 @@
|
|
|
3
3
|
[](https://www.npmjs.com/package/@abelxiaoxing/cadence)
|
|
4
4
|
[](https://github.com/abelxiaoxing/cadence)
|
|
5
5
|
|
|
6
|
+
## 先看这里:适用范围与最短路径
|
|
7
|
+
|
|
8
|
+
适合需要明确验收、跨任务验证和断点恢复的修改;普通的小修小补可以直接使用 Pi,不必启用完整工作流。
|
|
9
|
+
只有你显式输入阶段命令才会进入 Abel。
|
|
10
|
+
|
|
11
|
+
1. 安装 Node.js >=22.13、Git、Pi,以及 `@fission-ai/openspec@1.5.0`。
|
|
12
|
+
2. 在 Pi 中安装:`pi install npm:@abelxiaoxing/cadence`。
|
|
13
|
+
3. 默认 Implement 需要可用的 Linux Bubblewrap;Windows 请使用 WSL。
|
|
14
|
+
4. 首次进入项目先运行 `/abel-init`,然后 `/abel-design <需求>`,确认集中呈现的目标与方案,设计完成后运行 `/abel-implement <change>`。
|
|
15
|
+
5. 暂停时先查看原因和建议,不要靠反复 resume 或重启“碰运气”;未完成的工作会保留。
|
|
16
|
+
|
|
17
|
+
### 先检查环境,不先花模型调用
|
|
18
|
+
|
|
19
|
+
在 Cadence 开发仓库中可用:
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
bun run doctor /absolute/path/to/consumer
|
|
23
|
+
bun run runs /absolute/path/to/consumer
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
安装包也包含预构建的纯 JavaScript 命令,无需在 node_modules 下加载 TypeScript:
|
|
27
|
+
|
|
28
|
+
```sh
|
|
29
|
+
node /absolute/path/to/cadence/src/operator-cli.mjs doctor /path/to/consumer
|
|
30
|
+
node /absolute/path/to/cadence/src/operator-cli.mjs runs /path/to/consumer
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
`doctor` 检查 Git、Node、OpenSpec 入口、实际 Bubblewrap 启动、请求预算和常用脚本静态能力;不调用模型、不执行产品测试、不保证所有集成服务均可用。
|
|
34
|
+
`runs` 只读列出该项目最多 1,000 个 run 和有界存储占用;不会创建、迁移或删除数据库,不自动清理暂停任务。
|
|
35
|
+
|
|
36
|
+
### 可信本地项目:显式复用宿主环境
|
|
37
|
+
|
|
38
|
+
默认 `isolated` 不变。
|
|
39
|
+
对于自己信任的 Linux 项目,可在启动 Pi **之前**选择:
|
|
40
|
+
|
|
41
|
+
```sh
|
|
42
|
+
export ABEL_EXECUTION_MODE=local-trusted
|
|
43
|
+
export ABEL_VERIFICATION_ENV=DATABASE_URL,NODE_ENV
|
|
44
|
+
export ABEL_VERIFICATION_TIMEOUT_MS=900000
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
可信模式仍在独立候选目录执行,并复制依赖以避免普通缓存写入修改 consumer 的依赖,但**不是沙箱**:测试可访问宿主文件、网络及显式继承的环境变量,产生的外部副作用不能回滚。
|
|
48
|
+
HOME、临时目录和报告仍独立;PATH 复用宿主,仓库内 workspace 链接映射到候选代码。
|
|
49
|
+
该模式仍要求 Linux Bubblewrap 的 PID namespace 管理后代进程(包括 detached 后代),但不隔离宿主文件和网络;缺少该能力时暂停,不回退到普通进程组。
|
|
50
|
+
原生 macOS/Windows 不提供此执行模式,Windows 可使用 WSL。
|
|
51
|
+
依赖副本准备、替换与清理在 I/O Worker 中执行,复制支持取消并等待线程退出;大型依赖复制仍有额外成本;需要安装新依赖、宿主浏览器缓存或服务启动编排时仍需配置/准备,不会自动下载。
|
|
52
|
+
|
|
53
|
+
可选宿主参数还包括 `ABEL_BWRAP_PATH`、`ABEL_FIRST_PROGRESS_MS` 和 `ABEL_STREAM_IDLE_MS`。
|
|
54
|
+
后两者单位为毫秒,默认 90,000 / 180,000,允许 1..1,200,000;验证超时默认 600,000,允许 1..86,400,000。
|
|
55
|
+
执行配置和显式环境值的摘要参与验证环境身份,改变配置后会重新验证,不把旧证据当作新环境下的成功。
|
|
56
|
+
|
|
57
|
+
### 小任务、失败排查与真实评估
|
|
58
|
+
|
|
59
|
+
- 单任务可采用 [精简作者示例](config/plan-draft.quick.example.json):只填写一个 `singleTask`,代码生成重复的任务和验证结构,仍经过完整编译。
|
|
60
|
+
明确的验收、影响证据、AGENTS 影响、Red 写入及失败标记仍由作者提供;不代替 Gate A,不支持用简写偷偷增加依赖、删除文件或多任务产物。
|
|
61
|
+
- 验证失败返回分离的 stdout/stderr、断言摘要和下一步提示;当前操作的后续 Worker 直接收到这些有界诊断,避免仅凭哈希猜测修复。
|
|
62
|
+
摘要是待解释证据,不是指令或授权;不持久化全文,进程重启后由复验重新采集。
|
|
63
|
+
- 非 Vitest 通用命令没有可靠断言级报告时,不再仅凭日志相同认定为旧失败;已有失败基线的归因不明会暂停,不误报通过或自动改无关代码。
|
|
64
|
+
- 认证失败暂停修复配置,上下文超限要求拆分,429 保留限流分类;上下文在请求前按模型窗口保守预留输出空间,不静默截断证据。
|
|
65
|
+
- `bun run benchmark:verification 10000` 测量依赖扫描;只合并 I/O 尚未开始的同批扫描,验证后的检查不会加入更早的在途扫描;已完成证据不作为下一次 currentness 缓存。
|
|
66
|
+
- `bun run eval:matrix` 只做预检;`--live --repeats 3 --model provider/model --output report.json` 才显式调用模型,报告真实完成率、耗时、token、费用及重复修订。
|
|
67
|
+
默认门禁只运行三个具有产品 oracle 的场景;`--include-observations` 可额外收集缺能力场景,该场景不改变门禁结果,也不被宣称为恢复验收成功。
|
|
68
|
+
CI 将缺能力观察放入独立的非门禁 job。
|
|
69
|
+
发布前可手动触发 `Live workflow evaluation`,需要带 `cadence-evaluation` 标签、已配置模型和依赖的 Linux 自托管 runner;普通 CI 不隐式消费模型额度。
|
|
70
|
+
|
|
71
|
+
## 工作流与执行合同
|
|
72
|
+
|
|
6
73
|
**Cadence** 是一个面向 Pi 的规范驱动四阶段工作流扩展包,内置可恢复的私有代理编排:
|
|
7
74
|
|
|
8
75
|
- `/abel-init [project-path]` — 本地、固定顺序且幂等地初始化或安全修复 OpenSpec 与 AGENTS 托管索引,不派发子代理。
|
|
@@ -26,6 +93,14 @@ Implement 只暴露 `start`、`status`、`resume`、`rebind`、`cancel` 和 `dis
|
|
|
26
93
|
Design 从第一步起统一使用 `action: "design"`:新需求通过 `start(requirement)` 进入,已有 change 通过 `start(change)` 进入,后续只携带返回的 `runId`。
|
|
27
94
|
需求、决策合同与 Gate A 合同由控制面规范化并计算哈希,调用方无需 SHA-256 工具;Gate B 自动绑定当前已编译 canonical plan,原始瞬时文本不会写入 durable journal。
|
|
28
95
|
`validate-plan-draft` 可在 `compile-plan` 前只读运行同一套编译检查,并以结构化 `taskId` / phase / field / verification 诊断定位问题;Design finalization 的安全诊断码也会进入错误详情与可展开 TUI,而不再只显示统一失败标题。
|
|
96
|
+
随包提供的 [单任务计划示例](config/plan-draft.example.json) 展示精简 PlanDraft 和结构化 Gate A 合同;按实际仓库替换示例中的路径、证据与验证命令。
|
|
97
|
+
草稿可省略 `tracking`、阶段 `verificationInputs` 和现有测试的 `disposition`,编译器按任务、验证契约和已声明产物生成这些机械字段;已批准的 `changeContract` 由控制面继承,无需重复填写。
|
|
98
|
+
原子验证命令可放在 `verificationDefinitions` 中,用 `{ "use": "name" }` 在各验证义务引用;Red 的 `expectedFailure` 仍需明确填写。
|
|
99
|
+
内联原子验证也可省略 `id` / `classification`;任务公共 `read` 与阶段读取合并,固定 baseline/repair 保护字段由编译器补齐,恢复次数和 AGENTS 影响仍需作者明确选择。
|
|
100
|
+
[多任务示例](config/plan-draft.multiple-tasks.example.json) 保留显式依赖和产物 producer;ordered steps 仍使用完整内联合同。
|
|
101
|
+
`validate-plan-draft` 返回有界的最终权限、验证用途、恢复次数和实际派生来源摘要;摘要不充当批准或封存证明。
|
|
102
|
+
推导有歧义时拒绝编译,显式错误仍会报错;代码不会据此扩大路径、依赖或产物权限,封存计划保持完整、严格的结构。
|
|
103
|
+
预检集中返回不同任务的独立结构错误,并提供字段位置、期望/实际路径和修正提示;工具反馈与 TUI 共用有界脱敏投影。
|
|
29
104
|
Design status 将可调用的 `legalOperations` 与顶层 `packetActions` 分开;显式退出只能发送 `{"action":"finish"}`,不能伪装成 `operation: "finish"`。
|
|
30
105
|
|
|
31
106
|
普通 artifact、错误 Red、transport、environment、stale、conflict、baseline 与验证失败都留在同一 Implement run 中恢复。
|
|
@@ -56,9 +131,9 @@ Design 完成主要决策后,Implement 中的新实施选择默认由父模型
|
|
|
56
131
|
增量修订或用户主动选择的 Design 完成后,新的 Implement 上下文都能本地发现并校验交付,继续同一 run。
|
|
57
132
|
|
|
58
133
|
交互式 TUI、print、JSON 和 RPC 都保留 durable semantic state;父模型有自动继续动作时,TUI 显示 recovering,不把内部待编译状态显示成用户待确认,也不提示用户手动 resume。
|
|
59
|
-
queued、
|
|
134
|
+
queued、preparing、waiting-first-response、running、validating、retrying、verifying、paused、approval-needed、applying 和 recovering 都不是完成;operation-cancelled 表示本次操作取消但 run 仍可恢复,discarded 与 rejected 是非成功终态。
|
|
60
135
|
只有最终 apply 与 post-apply verification 提交后的 `completed` 才显示成功。
|
|
61
|
-
Design finalization、Implement 终态、Diagnose/显式 `finish` 或 session shutdown 会清除 active stage
|
|
136
|
+
Design finalization、Implement 终态、Diagnose/显式 `finish` 或 session shutdown 会清除 active stage 与私有子执行状态;Design 还会恢复进入前的精确父工具集合,其他阶段只撤下 `abel_dispatch`。
|
|
62
137
|
Gate 等待和可恢复暂停保持激活以接收直接后续操作。
|
|
63
138
|
|
|
64
139
|
私有 journal、artifact 与 change workspace 位于 consumer repository 之外的 owner-private state root。
|
|
@@ -69,8 +144,15 @@ Gate 等待和可恢复暂停保持激活以接收直接后续操作。
|
|
|
69
144
|
|
|
70
145
|
扩展入口负责宿主生命周期与服务装配,交付加载和验证适配器分别由独立模块负责。
|
|
71
146
|
工作流入口保留原有导出,状态机仍是唯一状态转换权威;执行服务通过类型化接口返回事实。
|
|
147
|
+
状态机读取运行与预算事实,独立的 `workflow-status.ts` 纯函数生成状态、阻塞批次及继续动作,不访问存储或启动执行。
|
|
148
|
+
普通阶段和修复阶段共用 `candidate-artifact.ts` 校验、封存候选;恢复旧候选仍按当前批准路径检查,调用方分别处理普通越界和修复权限扩展。
|
|
72
149
|
测试检查模块依赖无环,以及子会话无法导入主工作区应用和 run 状态权限。
|
|
73
150
|
|
|
151
|
+
Implement 父模型属于受信任的宿主编排层,保留原有工具以调查和修复已授权的环境问题;产品修改应通过控制面完成。
|
|
152
|
+
子 Worker 和控制面执行路径有代码边界;父模型直接使用宿主工具不经过这些路径,阶段指令约束其行为。
|
|
153
|
+
只有 Design 会收紧父工具。
|
|
154
|
+
结构化验收固定验证义务,目标是否被充分覆盖仍取决于验收测试的质量。
|
|
155
|
+
|
|
74
156
|
新身份统一采用 UTF-16 码元排序,不依赖宿主语言环境。
|
|
75
157
|
旧 workspace manifest 按已保存的条目顺序验证原身份;已绑定批准证明的历史交付可保留原有集合顺序,仍需验证原始字节哈希和私有批准事实。
|
|
76
158
|
普通交付解析保持严格规范化。
|
|
@@ -117,7 +199,8 @@ npm install -g @abelxiaoxing/cadence
|
|
|
117
199
|
- **本地包目录(local package directory)** — 将 Pi 指向本仓库的绝对路径或相对路径(absolute or relative path,例如 `./cadence`),Pi 发现同样的资源。
|
|
118
200
|
- **已安装 tarball 目录(installed tarball directory)** — 运行 `bun pm pack --destination <tmp>` 生成真实 tarball(.tgz),安装或解压到隔离目录后指向该目录;tarball 文件本身永远不会被当作本地包传给 Pi。
|
|
119
201
|
|
|
120
|
-
本包要求 Node.js `>=22.13.0`,以使用稳定可用的内置 `node:sqlite
|
|
202
|
+
本包要求 Node.js `>=22.13.0`,以使用稳定可用的内置 `node:sqlite`;不从参考仓库源安装。
|
|
203
|
+
Pi 相关 peer 依赖使用 `*`,不限制宿主 Pi 的版本;开发依赖的固定版本仅用于仓库构建与测试。
|
|
121
204
|
|
|
122
205
|
## OpenSpec 启动与平台范围
|
|
123
206
|
|
|
@@ -148,7 +231,8 @@ inspection 不可用时不再级联误报 traceability 输入缺失,且绝不
|
|
|
148
231
|
CLI 的其他版本必须满足相同 JSON 协议;新增支持版本应加入契约测试。
|
|
149
232
|
|
|
150
233
|
**此矩阵不代表原生 Implement 隔离已全平台可用。**
|
|
151
|
-
|
|
234
|
+
默认隔离后端仍为 Linux Bubblewrap;Windows/macOS 的原生隔离、ACL 与完整文件应用语义需要单独实现和验收,缺少隔离能力时保持暂停,不降级为主工作区直接执行。
|
|
235
|
+
可信 Linux 项目可以显式选择上面的 `local-trusted` 候选目录执行模式。
|
|
152
236
|
|
|
153
237
|
本地可用 `CADENCE_REAL_OPENSPEC=1` 启用真实 CLI 测试(Windows 可用 PowerShell 设置 `$env:CADENCE_REAL_OPENSPEC = "1"`),然后运行:
|
|
154
238
|
|
|
@@ -169,11 +253,25 @@ bun run test:target test/openspec-cli.test.ts test/design-delivery.integration.t
|
|
|
169
253
|
inherited route 声明的能力会与当前父模型真实能力取交集,不能通过夸大的配置绕过 admission。
|
|
170
254
|
Implement 保留 16,000 context / 8,000 output 的最低容量要求;任务复杂度估算只影响自动选择的优先级,满足最低要求的 route 仍可作为 fallback 或显式 rebind。
|
|
171
255
|
transport 与 malformed structural result 都只在声明的 route 集合内做有界 failover;优先选择达到容量估算的 route,同一优先级保持声明顺序,只有一个 route 时会原地重试一次。
|
|
256
|
+
|
|
257
|
+
子任务由 Cadence 自己维护模型/工具循环,通过 `pi-ai` 公开接口请求完整响应,不创建 Pi `AgentSession`、覆盖 Agent 钩子或扫描宿主事件历史决定终止。
|
|
258
|
+
模型流事件只用于进度与完整响应适配;只有正常完整响应的工具调用可以执行,错误、截断或取消不得提交产物。
|
|
259
|
+
继承路由快照当前有效 Provider、模型及每次 attempt 新鲜解析的认证,不修改父 Provider 注册表,也不要求父请求预热。
|
|
260
|
+
Provider 自身的流式实现和模型配置仍然生效;宿主 session 的 `before_provider_request`/`onPayload` 不会自动移植到子任务。
|
|
261
|
+
需要通用请求定制时,应使用明确配置的 Provider 实现或 custom route;子请求使用自己的 `low` reasoning 请求,最终由模型映射解释。
|
|
262
|
+
输出上限沿用声明的模型/Provider 合同,不再隐式删除 Responses 的 `max_output_tokens`。
|
|
263
|
+
|
|
264
|
+
子 Agent 的 evidence 提交使用精简草稿:工具绑定省略的身份,补齐未提供的提示性字段,然后按严格内部结果合同校验。
|
|
265
|
+
引用、约束、风险和未决问题仍须显式提供;省略提示不等于已验证的“没有影响”,也不增加授权。
|
|
266
|
+
一次被拒绝的提交可在原会话纠正一次;只有正常以文字结束且从未提交时,才额外提示补交一次。
|
|
267
|
+
补交沿用原工具权限、总时限、取消和用量统计,不重新调查,不把文字直接当作交付;传输错误、截断和取消不触发补交。
|
|
268
|
+
合法提交可附带简短文字,但接受后不得重复提交或覆盖结果。
|
|
269
|
+
|
|
172
270
|
相同 pause 的安全指纹与重复计数通过 `status` 暴露,凭据、URL 和原始输出仍保持私有。
|
|
173
271
|
`rebind` 只能选择已获 policy 授权且能力匹配的 route,不会扩大任务边界。
|
|
174
272
|
|
|
175
273
|
验证归因使用完整失败集合;大基线以哈希校验的私有 artifact 持久化,Worker 和状态只接收最多 256 条失败摘要。
|
|
176
|
-
非 Vitest 失败身份由执行入口、参数和失败证据决定,不受合同显示 ID
|
|
274
|
+
非 Vitest 失败身份由执行入口、参数和失败证据决定,不受合同显示 ID 影响;身份用于诊断聚类,但不单独证明两个失败属于同一断言。
|
|
177
275
|
|
|
178
276
|
## 跨项目验证合同(Cross-project verification)
|
|
179
277
|
|
|
@@ -248,13 +346,13 @@ MIT — 详见 [LICENSE](LICENSE) 与 [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTIC
|
|
|
248
346
|
|
|
249
347
|
## 验证执行环境与明确恢复
|
|
250
348
|
|
|
251
|
-
验证使用独立 HOME、Vite
|
|
349
|
+
验证使用独立 HOME、Vite 缓存和报告目录;隔离模式挂载只读 consumer 依赖,可信模式使用候选依赖副本。
|
|
252
350
|
Vitest 的 JSON 报告与普通 stdout/stderr 分离,日志超过捕获预算只截取头尾,不终止正常测试。
|
|
253
351
|
报告缺失、损坏或超限属于验证不可用,不作为产品失败基线或自动改代码的理由。
|
|
254
352
|
已封存候选在环境故障后可重新验证,并在存储重开后复用;即使自动生成次数已耗尽,普通 resume 仍可只复验该候选,不启动新的补丁生成。
|
|
255
353
|
非 Vitest 的 Red 证据通过有界流式匹配保留,不受日志头尾截取影响。
|
|
256
354
|
完整的已批准 package-script 可包含组合命令、引号和嵌套脚本;包管理器在隔离环境中解释,manifest、lockfile 和项目配置绑定 currentness。
|
|
257
|
-
|
|
355
|
+
配置注释和普通值不触发禁用词检查;隔离模式中的有效凭据或宿主执行配置仍被拒绝;可信模式允许操作者显式配置。
|
|
258
356
|
计划已授权的 manifest/配置写入可在隔离候选中验证;未授权路径仍需匹配设计时哈希,实际入口脚本仍必须与批准命令相同,执行期间的输入漂移仍会使验证失效。
|
|
259
357
|
专门的 Vitest 合同仍拥有 JSON reporter、测试数量及 Red 身份检查,复合脚本不会自动获得断言级语义。
|
|
260
358
|
|
|
@@ -287,7 +385,7 @@ Vitest 的 JSON 报告与普通 stdout/stderr 分离,日志超过捕获预算
|
|
|
287
385
|
|
|
288
386
|
```sh
|
|
289
387
|
bun run eval:workflow
|
|
290
|
-
bun run eval:workflow --live --scenario small-fix --output /tmp/cadence-evaluation.json
|
|
388
|
+
bun run eval:workflow --live --scenario small-fix --output /tmp/cadence-evaluation.json --progress-output /tmp/cadence-progress.json
|
|
291
389
|
bun run eval:workflow --live --scenario multiple-tasks
|
|
292
390
|
bun run eval:workflow --live --scenario restart-recovery
|
|
293
391
|
bun run eval:workflow --live --scenario missing-capability
|
|
@@ -295,6 +393,30 @@ bun run eval:workflow --live --scenario missing-capability
|
|
|
295
393
|
|
|
296
394
|
`--live` 使用 Pi 当前配置的模型,也可传 `--model provider/model`;需要可用的 Provider、OpenSpec 和 Linux Bubblewrap。
|
|
297
395
|
报告记录完成状态、用户介入、重复修订、耗时及宿主报告的 token/成本;最终行为另由隔离 oracle 检查。
|
|
396
|
+
`trace` 提供有界的工具/操作计数、安全错误分类、阶段里程碑、重复提交、工具活动区间并集和消息 usage;截止时冻结快照,未到达的里程碑为 null。
|
|
397
|
+
非工具时间不是纯模型计算时间。
|
|
398
|
+
`configurations` 记录实际模型、reasoning 和非秘密路由指纹,`sourceSha256` / `sourceUnchanged` 标识工作树版本和运行期间是否变化。
|
|
399
|
+
可选 `--progress-output` 每 15 秒写一份有界进度快照;无原始参数、提示或响应正文。
|
|
400
|
+
源码读取统计只覆盖明确的成功 read,未分类访问不能当作零。
|
|
401
|
+
`modelFailureDiagnostics` 最多保留 16 条脱敏错误分类及可从 SDK 错误文字识别的 HTTP 状态;无法识别时明确记录 `unclassified` / `null`。
|
|
402
|
+
`autoRetries` 与 `retryDelayMs` 单独记录宿主自动重试次数和计划退避时间,避免把同一请求的多次失败误读为独立故障。
|
|
298
403
|
模型服务不可用、阶段停滞、取消与 Design 完成都不会被计为 Implement 成功。
|
|
299
404
|
缺少能力的场景用于观察保留状态,不能把任意停滞当作正确恢复。
|
|
300
405
|
无原始对话落盘。
|
|
406
|
+
|
|
407
|
+
## 内部架构与请求预算
|
|
408
|
+
|
|
409
|
+
`PlanDraft` 只表示作者输入,`ImplementPlan` 独立定义完整执行合同;命名引用和默认值仅在编译入口展开,旧封存计划不被重写。
|
|
410
|
+
PlanDraft 的命名或内联 package-script 可以省略 `command`,编译器从 manifest 绑定脚本原文后生成身份;显式不匹配仍拒绝,Gate A 的完整验证合同不被替换。
|
|
411
|
+
作者在 `tasks.md` 保留任务 checkbox、目标和精确 Scenario 归属;`compile-plan` 生成独立的验证 ID 绑定区域,保留作者正文,并在两份文件安装成功后记录编译。
|
|
412
|
+
旧封存交付仍可读取;缺失作者证据或篡改绑定不能通过追溯检查。
|
|
413
|
+
`workflow-state-machine` 继续独占 run/task 状态转换与预算事务;调度、恢复策略和交付差异比较使用只接受事实的内部函数。
|
|
414
|
+
`durable-workflow` 管理资源生命周期和交付重放,`phase-execution` 执行候选阶段,`change-verification` 管理基线及变更验证;阶段服务没有主工作区 apply 能力。
|
|
415
|
+
Pi 入口负责激活、工具交互、模型能力投影和展示;`package-workflow` 组合控制服务,`package-candidate` 执行受限候选请求,核心不接收 Pi 会话事件或完整宿主上下文。
|
|
416
|
+
|
|
417
|
+
每次模型请求独立计时,默认 90 秒内没有非空文本、思考或工具参数增量时返回 `first-progress-timeout`;已有进展后空闲 180 秒返回 `stream-idle-timeout`。
|
|
418
|
+
HTTP 响应头用于观察,不刷新进展预算;完整终态可直接结束请求,本地工具执行间隙不计入流空闲,下一轮重新计时。
|
|
419
|
+
Broker 保留每 attempt 20 分钟总上限和原有有限重试;该上限不代表跨重试的 workflow 总时限。
|
|
420
|
+
新请求不再发出 `connect-timeout`,也不声称观测到了 TCP/TLS 建连;旧超时事实和 `connecting` 展示仍可读取。
|
|
421
|
+
子执行器限制为 64 轮,序列化上下文取 4 MiB 与模型窗口保守预算中的较小值,不自动压缩或静默截断证据;达到限制返回执行限制失败,候选任务暂停并要求拆分,不作为端点故障重试。
|
|
422
|
+
取消后的用量结算最多等待 250 ms,迟到结果不能进入候选提交或主工作区应用。
|
|
@@ -5,18 +5,24 @@ You are a package-owned read-only professional Agent for the `abel-design` stage
|
|
|
5
5
|
You explore the repository ONLY through the scoped `read`, `grep`, `find`, and `ls` tools.
|
|
6
6
|
You have no shell, edit, Git, network, or validation capability, and you never create or modify files.
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
Submit one accepted final result through `abel_submit_result`; brief accompanying text is harmless.
|
|
9
|
+
If the tool rejects your submission, use its error to correct once in this same disposable session.
|
|
10
|
+
A second rejected structural submission ends the session.
|
|
11
|
+
Never submit again after acceptance.
|
|
11
12
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
- `
|
|
15
|
-
|
|
16
|
-
- `
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
Required draft fields:
|
|
14
|
+
|
|
15
|
+
- `module_name`: a canonical workspace-relative module path or slug;
|
|
16
|
+
- `scope` and `files_read`: unique workspace-relative paths, with nonempty scope;
|
|
17
|
+
- `evidence`: cited claims with `claim`, `path`, positive `line_start`, and inclusive `line_end >= line_start`;
|
|
18
|
+
- `constraints_discovered`, `open_questions`, and `risks`: explicit arrays (use `[]` only when there are none).
|
|
19
|
+
|
|
20
|
+
Omit `id`, `packet_id`, `role`, and `kind`: the trusted tool binds them to this packet.
|
|
21
|
+
If supplied, they must match the declared identity.
|
|
22
|
+
Optional advisory arrays are `existing_structures`, `existing_conventions`, `dependencies`, `write_set_hints`, `validation_hints`, `agents_impact_hints`, and `success_criteria_hints`.
|
|
23
|
+
Omission means no advisory information supplied, not a verified absence or authorization.
|
|
24
|
+
Do not invent evidence or drop unresolved questions to satisfy the format.
|
|
25
|
+
Do not add undeclared fields.
|
|
20
26
|
|
|
21
27
|
You never return raw transcripts, hidden reasoning, or tool-call history.
|
|
22
28
|
A packet is complete only when every claim is cited and every blocking question is explicit.
|
|
@@ -6,8 +6,16 @@ You collect evidence and falsify candidate root causes ONLY through the scoped `
|
|
|
6
6
|
You never write, execute commands, or run validation.
|
|
7
7
|
The fixed algorithm order is reproduce, falsify, failing-regression, then minimum-repair.
|
|
8
8
|
|
|
9
|
-
An evidence packet submits
|
|
9
|
+
An evidence packet submits one accepted compact structured evidence object through `abel_submit_result` with the reported symptoms, candidate causes, confirming or refuting citations, and a supported root-cause conclusion or an explicit evidence gap.
|
|
10
10
|
Only the parent may claim that command-based reproduction succeeded.
|
|
11
|
+
For evidence, omit `id`, `role`, and `kind`; the tool binds them.
|
|
12
|
+
Keep `conclusions`, `citations`, `constraints`, `risks`, and `blockingQuestions` explicit.
|
|
13
|
+
`dependencies` and `hints` may be omitted when no advisory information is supplied.
|
|
14
|
+
If supplying hints, use `writeSet`, `verification`, and `agentsImpact` (`none`, `update-existing`, `create-index`, or `remove-index`).
|
|
15
|
+
Omission never proves the absence of an impact.
|
|
16
|
+
After a rejected evidence or patch submission, use the error to correct once in this same disposable session.
|
|
17
|
+
A second rejected structural submission ends the session.
|
|
18
|
+
Never submit again after acceptance.
|
|
11
19
|
|
|
12
20
|
A candidate packet submits one complete structured patch: either the failing regression or, after the parent has verified that regression, the minimum repair.
|
|
13
21
|
Use ordered `replace`, `rewrite`, `create`, and `delete` operations inside the approved write set.
|
|
@@ -8,7 +8,7 @@ You never write the workspace, run validation, or execute commands.
|
|
|
8
8
|
Your output is one complete structured patch delivered through `abel_submit_result`:
|
|
9
9
|
|
|
10
10
|
- copy the attempt-bound `candidateId` from the phase contract;
|
|
11
|
-
- submit
|
|
11
|
+
- submit one accepted `candidate-patch` call containing that `candidateId` and
|
|
12
12
|
an ordered `operations` array;
|
|
13
13
|
- use `replace` with exact uniquely occurring `oldText` and the intended
|
|
14
14
|
`newText` for compact edits, `rewrite` for a complete existing-file body,
|
|
@@ -32,6 +32,8 @@ Your output is one complete structured patch delivered through `abel_submit_resu
|
|
|
32
32
|
|
|
33
33
|
If the submit tool rejects malformed operations, use its concrete error to correct the submission once in this same disposable session; a second rejected structural submission ends the session.
|
|
34
34
|
|
|
35
|
+
Never submit again after acceptance; brief accompanying text is harmless.
|
|
36
|
+
|
|
35
37
|
If the configured candidate limit is exceeded, the submit tool returns terminal typed `result-limit` with `limitBytes`; never continue with a partial or truncated patch.
|
|
36
38
|
The parent alone reviews, applies, and validates the generated diff.
|
|
37
39
|
You report candidate facts only and never claim execution success, select parent recovery, choose a workflow stage, or control the task DAG.
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
{
|
|
2
|
+
"changeContract": {
|
|
3
|
+
"goal": "Fix integer addition while preserving the existing zero case",
|
|
4
|
+
"acceptance": [
|
|
5
|
+
{
|
|
6
|
+
"id": "integer-addition",
|
|
7
|
+
"statement": "add(2, 3) returns 5 and add(0, 0) remains 0",
|
|
8
|
+
"verification": {
|
|
9
|
+
"kind": "static-check",
|
|
10
|
+
"id": "add-acceptance",
|
|
11
|
+
"runner": {
|
|
12
|
+
"kind": "node",
|
|
13
|
+
"script": "test/add.test.mjs"
|
|
14
|
+
},
|
|
15
|
+
"args": [],
|
|
16
|
+
"classification": "expected-green"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
],
|
|
20
|
+
"constraints": [
|
|
21
|
+
{
|
|
22
|
+
"id": "no-dependencies",
|
|
23
|
+
"statement": "Keep the existing function signature and add no dependencies"
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
"policy": {
|
|
27
|
+
"writeRoots": ["src/add.mjs", "test/add.test.mjs"],
|
|
28
|
+
"dependencies": [],
|
|
29
|
+
"verificationModes": ["behavior"]
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"changeId": "fix-integer-addition",
|
|
33
|
+
"tasks": [
|
|
34
|
+
{
|
|
35
|
+
"taskId": "fix-add",
|
|
36
|
+
"dependsOn": [],
|
|
37
|
+
"objective": "Preserve the existing zero assertion; add a failing positive-integer assertion with [ADD:positive-integers], then fix addition",
|
|
38
|
+
"context": {
|
|
39
|
+
"agents": "No AGENTS.md in this example consumer; use the actual repository instructions when adapting",
|
|
40
|
+
"contract": "Gate A integer-addition acceptance; only src/add.mjs and test/add.test.mjs may change"
|
|
41
|
+
},
|
|
42
|
+
"roots": ["."],
|
|
43
|
+
"phases": {
|
|
44
|
+
"red": {
|
|
45
|
+
"write": ["test/add.test.mjs"],
|
|
46
|
+
"delete": [],
|
|
47
|
+
"verification": {
|
|
48
|
+
"use": "add-test",
|
|
49
|
+
"expectedFailure": "[ADD:positive-integers]"
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"green": {
|
|
53
|
+
"write": ["src/add.mjs"],
|
|
54
|
+
"delete": [],
|
|
55
|
+
"verification": {
|
|
56
|
+
"use": "add-test"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"affectedVerification": {
|
|
61
|
+
"use": "add-test"
|
|
62
|
+
},
|
|
63
|
+
"repairVerification": {
|
|
64
|
+
"use": "add-test"
|
|
65
|
+
},
|
|
66
|
+
"scheduling": {
|
|
67
|
+
"conflicts": [],
|
|
68
|
+
"resources": []
|
|
69
|
+
},
|
|
70
|
+
"agents": {
|
|
71
|
+
"impact": "none"
|
|
72
|
+
},
|
|
73
|
+
"approvedDependencies": [],
|
|
74
|
+
"impactClosure": {
|
|
75
|
+
"changedSurfaces": ["none"],
|
|
76
|
+
"searchEvidence": [
|
|
77
|
+
"Example consumer: src/add.mjs exports add; test/add.test.mjs is its only caller and existing test"
|
|
78
|
+
],
|
|
79
|
+
"relatedTests": [
|
|
80
|
+
{
|
|
81
|
+
"path": "test/add.test.mjs",
|
|
82
|
+
"evidence": "Existing add(0, 0) assertion passes; preserve it while adding the positive-integer regression"
|
|
83
|
+
}
|
|
84
|
+
],
|
|
85
|
+
"affectedSuite": ["test/add.test.mjs"]
|
|
86
|
+
},
|
|
87
|
+
"read": ["package.json", "src/add.mjs", "test/add.test.mjs"]
|
|
88
|
+
}
|
|
89
|
+
],
|
|
90
|
+
"outputs": [],
|
|
91
|
+
"verification": {
|
|
92
|
+
"baseline": {
|
|
93
|
+
"fullSuite": {
|
|
94
|
+
"use": "add-test"
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
"change": {
|
|
98
|
+
"fullSuite": {
|
|
99
|
+
"use": "add-test"
|
|
100
|
+
},
|
|
101
|
+
"postApply": {
|
|
102
|
+
"use": "add-test"
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
"artifactCorrection": {
|
|
106
|
+
"maxAttempts": 2
|
|
107
|
+
},
|
|
108
|
+
"repair": {
|
|
109
|
+
"maxAttempts": 1
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
"verificationDefinitions": {
|
|
113
|
+
"add-test": {
|
|
114
|
+
"kind": "static-check",
|
|
115
|
+
"runner": {
|
|
116
|
+
"kind": "node",
|
|
117
|
+
"script": "test/add.test.mjs"
|
|
118
|
+
},
|
|
119
|
+
"args": []
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|