@abelxiaoxing/cadence 1.0.0 → 1.0.2
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 +50 -22
- package/package.json +3 -1
- package/prompts/abel-design.md +1 -0
- package/prompts/abel-diagnose.md +1 -0
- package/prompts/abel-implement.md +14 -2
- package/skills/abel-workflow/SKILL.md +7 -1
- package/src/candidate-preflight.ts +1163 -0
- package/src/child-session.ts +98 -10
- package/src/contracts.ts +379 -48
- package/src/file-snapshot.ts +62 -8
- package/src/index.ts +191 -14
- package/src/parent-payload-bridge.ts +442 -0
- package/src/parent-provider.ts +124 -16
- package/src/patch.ts +73 -3
- package/src/result-store.ts +40 -3
- package/src/runtime.ts +1013 -60
- package/src/scheduler.ts +47 -10
- package/src/scoped-tools.ts +27 -6
- package/src/subagent-activity.ts +747 -0
- package/src/submit-tool.ts +3 -1
- package/src/worker.ts +136 -26
package/README.md
CHANGED
|
@@ -1,41 +1,69 @@
|
|
|
1
1
|
# @abelxiaoxing/cadence
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/@abelxiaoxing/cadence)
|
|
4
|
+
[](https://github.com/abelxiaoxing/cadence)
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
- `/abel-design <requirement> | --change <change_name>` — parallelize read-only exploration and design a dependency/conflict-aware task DAG through Gate A and Gate B.
|
|
7
|
-
- `/abel-implement <change_name>` — orchestrate task-local professional Agents over the approved DAG with delegated Red-Green-Refactor and parent-owned verification.
|
|
8
|
-
- `/abel-diagnose <problem-description>` — verify a root cause before a minimal repair.
|
|
6
|
+
**Cadence** 是一个面向 pi 的规范驱动四阶段工作流扩展包,内置私有代理编排:
|
|
9
7
|
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
- `/abel-init [project-path]` — 初始化 OpenSpec 并修复 AGENTS 索引。
|
|
9
|
+
- `/abel-design <requirement> | --change <change_name>` — 并行只读探索,设计依赖/冲突感知的任务 DAG,经由 Gate A(行为契约)与 Gate B(技术契约)双重批准。
|
|
10
|
+
- `/abel-implement <change_name>` — 在已批准的 DAG 上编排任务级专业代理,委派 Red-Green-Refactor,由父代理执行验证。
|
|
11
|
+
- `/abel-diagnose <problem-description>` — 先验证根因,再做最小修复。
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
包是独立的:单一仓库、单一清单、单一 lockfile,无 workspace、无参考仓库检出、不依赖任何外部 Subagent 包。
|
|
14
|
+
加载本包会注册一个私有扩展与四个包内专业 Agent;`abel_dispatch` 工具注册但保持未激活,只有经过验证的 Design、Implement 或 Diagnose 阶段才会激活它。
|
|
14
15
|
|
|
15
|
-
|
|
16
|
+
共享工作流规则统一收录于包内 `abel-workflow` skill。
|
|
17
|
+
|
|
18
|
+
交互式 TUI 中,经过验证的 `abel_dispatch` run 会显示紧凑的 Subagent 角色、请求、阶段、目标、耗时和状态,并在编辑器上方临时汇总仍在排队或运行的 Agents。
|
|
19
|
+
|
|
20
|
+
该显示只保留有限的终态摘要;不会显示子会话、工具活动、路径、模型身份、隐藏推理、完整引用或完整 diff。
|
|
21
|
+
|
|
22
|
+
print、JSON 和 RPC 模式保持原有结果与事件行为不变。
|
|
23
|
+
|
|
24
|
+
## 安装(Install)
|
|
25
|
+
|
|
26
|
+
### 在 pi 中快速安装(推荐)
|
|
27
|
+
|
|
28
|
+
```sh
|
|
29
|
+
$ pi install npm:@abelxiaoxing/cadence
|
|
30
|
+
Installed npm:@abelxiaoxing/cadence
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
也可以使用 npm 或 bun:
|
|
16
34
|
|
|
17
35
|
```sh
|
|
18
36
|
npm install -g @abelxiaoxing/cadence
|
|
19
|
-
#
|
|
37
|
+
# 或使用 bun:bun add -g @abelxiaoxing/cadence
|
|
20
38
|
```
|
|
21
39
|
|
|
22
|
-
|
|
40
|
+
已验证的加载路径:
|
|
23
41
|
|
|
24
|
-
- **npm package
|
|
25
|
-
-
|
|
26
|
-
|
|
27
|
-
- **Installed tarball directory** — run `bun pm pack --destination <tmp>` to produce a real tarball, install or unpack it into an isolated directory, and point Pi at that directory.
|
|
28
|
-
The tarball file itself is never passed to Pi as a local package.
|
|
42
|
+
- **npm 包(npm package)** — 从 npm registry 以用户级或项目级 scope 安装 `@abelxiaoxing/cadence`;Pi 发现四个 prompts、四个 skills、私有扩展与包内 Agents。
|
|
43
|
+
- **本地包目录(local package directory)** — 将 Pi 指向本仓库的绝对路径或相对路径(absolute or relative path,例如 `./cadence`),Pi 发现同样的资源。
|
|
44
|
+
- **已安装 tarball 目录(installed tarball directory)** — 运行 `bun pm pack --destination <tmp>` 生成真实 tarball(.tgz),安装或解压到隔离目录后指向该目录;tarball 文件本身永远不会被当作本地包传给 Pi。
|
|
29
45
|
|
|
30
|
-
|
|
46
|
+
本包从不检查或分类 Pi 主机版本,不声明任何版本范围,也不从参考仓库源安装。
|
|
31
47
|
|
|
32
|
-
## Development
|
|
48
|
+
## 开发(Development)
|
|
33
49
|
|
|
34
50
|
```sh
|
|
35
51
|
bun install
|
|
36
|
-
bun run check #
|
|
52
|
+
bun run check # 语法 + 类型检查
|
|
37
53
|
bun run lint # biome + rumdl
|
|
38
|
-
bun run test #
|
|
39
|
-
bun run test:target <files> #
|
|
40
|
-
bun run check:agents # AGENTS
|
|
54
|
+
bun run test # 完整测试套件
|
|
55
|
+
bun run test:target <files> # 定向测试
|
|
56
|
+
bun run check:agents # AGENTS 索引校验
|
|
41
57
|
```
|
|
58
|
+
|
|
59
|
+
## 验证(Verification)
|
|
60
|
+
|
|
61
|
+
```sh
|
|
62
|
+
bun run verify # check && lint && test && pack:check(发布前全套校验)
|
|
63
|
+
bun run pack:check # 真实 tarball 39 成员清单校验
|
|
64
|
+
bun run traceability:check # 81 条 Requirement/Scenario 引用精确解析
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## 许可(License)
|
|
68
|
+
|
|
69
|
+
MIT — 详见 [LICENSE](LICENSE) 与 [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md)。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abelxiaoxing/cadence",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Prompts, skills, and a private orchestration extension exposing the Abel four-stage workflow (/abel-init, /abel-design, /abel-implement, /abel-diagnose) with package-owned professional Agents.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -48,11 +48,13 @@
|
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
50
|
"@earendil-works/pi-coding-agent": "*",
|
|
51
|
+
"@earendil-works/pi-tui": "*",
|
|
51
52
|
"typebox": "*"
|
|
52
53
|
},
|
|
53
54
|
"devDependencies": {
|
|
54
55
|
"@biomejs/biome": "^2.4.16",
|
|
55
56
|
"@earendil-works/pi-coding-agent": "0.84.1",
|
|
57
|
+
"@earendil-works/pi-tui": "0.84.2",
|
|
56
58
|
"@types/node": "^22.15.3",
|
|
57
59
|
"rumdl": "^0.2.10",
|
|
58
60
|
"typescript": "^6.0.3",
|
package/prompts/abel-design.md
CHANGED
package/prompts/abel-diagnose.md
CHANGED
|
@@ -10,6 +10,7 @@ Read the complete value inside `<abel-request>` without a second whitespace-toke
|
|
|
10
10
|
$ARGUMENTS
|
|
11
11
|
</abel-request>
|
|
12
12
|
|
|
13
|
+
<!-- ABEL:PROMPT:abel-diagnose -->
|
|
13
14
|
The request must uniquely identify one or more existing bugs.
|
|
14
15
|
If required input is missing or ambiguous, stop and ask for the missing or disambiguating information instead of guessing.
|
|
15
16
|
|
|
@@ -10,6 +10,7 @@ argument-hint: "<change_name>"
|
|
|
10
10
|
$ARGUMENTS
|
|
11
11
|
</abel-request>
|
|
12
12
|
|
|
13
|
+
<!-- ABEL:PROMPT:abel-implement -->
|
|
13
14
|
<!-- ABEL:START -->
|
|
14
15
|
**参数**:从 `<abel-request>` 读取必需的 `<change_name>`。
|
|
15
16
|
|
|
@@ -80,7 +81,8 @@ Implement 不重新作出或请求 Gate A/B 决策;只有 Gate receipts、arti
|
|
|
80
81
|
worker 消费任务契约的普通缩进符号列表(绝非 Markdown 复选框):前置条件、直接依赖、派发上下文、计划写集、冲突/资源锁、验证类型、Red 命令/预期失败原因、Green 预期行为、受影响套件命令、目标范围和 AGENTS 影响。
|
|
81
82
|
|
|
82
83
|
1. **🔴 Red(worker → 父代理)**:worker 只用契约规定的验证类型与范围生成失败验证 diff;父代理审查并应用后运行 Red 命令,必须因契约描述的目标缺陷失败。
|
|
83
|
-
|
|
84
|
+
加载/导入失败、未运行目标测试或失败身份与批准身份不同时,将结果分类为生成的实现产物拒绝并进入有界修正路径。
|
|
85
|
+
若 Red 在预检候选上通过,或批准命令无法在不改变行为、策略、依赖、架构、范围、写集或验证契约的情况下见证批准行为,则 Red 契约无效:立即返回 `/abel-design --change <name>`,不得消耗产物修正预算。
|
|
84
86
|
非行为变更任务以指定的失败静态验证起步;仅人工任务返回 Design。
|
|
85
87
|
2. **🟢 Green(worker → 父代理)**:同一 worker 基于已确认的 Red 证据生成最小实现 diff;父代理审查并应用后运行目标验证。
|
|
86
88
|
失败证据回传 worker,仅允许在声明写集和已批准行为内生成修正 diff。
|
|
@@ -92,6 +94,14 @@ worker 消费任务契约的普通缩进符号列表(绝非 Markdown 复选框
|
|
|
92
94
|
- 校验已索引的路径/命令/根到嵌套路由;运行该任务的 AGENTS 验证命令。
|
|
93
95
|
6. 父代理重跑目标与受影响验证;全绿后,仅在 schema `apply.tracks` 解析出的具体跟踪文件中更新匹配的那个任务复选框;零个/多个匹配 → 停止并返回 design。
|
|
94
96
|
|
|
97
|
+
Syntax, import/load, no-test, malformed-diff, and wrong-Red-identity failures are generated implementation-artifact rejection.
|
|
98
|
+
A wrong-Red result follows the same bounded artifact-correction path.
|
|
99
|
+
Every artifact rejection uses a finite artifact correction budget shared with the phase's mechanical redispatch budget.
|
|
100
|
+
When the artifact correction budget is exhausted, report `implementation-artifact-delivery-blocked`; it must not automatically return, transition, or route to Design.
|
|
101
|
+
An invalid Red contract is one where Red passes against the preflighted candidate, or where the approved command cannot witness the approved behavior without a substantive behavior, policy, dependency, architecture, scope, write-set, or verification-contract change.
|
|
102
|
+
An invalid Red contract must immediately return the contract defect to Design and must not consume the artifact correction budget.
|
|
103
|
+
Only an invalid Red contract or another substantive change to behavior, policy, dependency, architecture, scope, write set, or verification contract may route the branch to Design.
|
|
104
|
+
|
|
95
105
|
父代理拥有主工作区补丁应用、闸门、索引写入与任务完成状态;子代理只接收任务局部索引上下文,只返回统一 diff 与分析,绝不应用补丁、批准决策、编辑索引或推进状态。
|
|
96
106
|
|
|
97
107
|
## 最终评审与收尾
|
|
@@ -127,6 +137,8 @@ AGENTS: {none 的证据 | 更新的索引文件与原因}
|
|
|
127
137
|
If the required input is missing or absent, or the request is ambiguous and not unique, stop before any work and ask the user for the missing or clarified input.
|
|
128
138
|
|
|
129
139
|
Record target, affected suite, and full-suite baselines before writing; keep pre-existing failures separate and never attribute them to the task Red.
|
|
130
|
-
Red must fail with the expected identity
|
|
140
|
+
Red must fail with the expected identity; a wrong reason is a generated implementation-artifact rejection handled by bounded correction.
|
|
141
|
+
If Red passes against the preflighted candidate or the approved command cannot witness the approved behavior, the invalid Red contract returns immediately to Design without consuming the artifact correction budget.
|
|
142
|
+
After Green the target and affected suite must be green, in Red-Green-Refactor order, with a stable AGENTS index at checkpoints and no new failure relative to the recorded baseline.
|
|
131
143
|
A fresh-context handoff validates the Gate receipt, hash, and trace strictly without requesting Gate approval again.
|
|
132
144
|
You must not archive, publish, or commit implicitly: only explicit parent actions may do so.
|
|
@@ -34,7 +34,13 @@ Use Red-Green-Refactor for code, tests, and executable static contracts:
|
|
|
34
34
|
2. **Green:** implement the minimum approved change and run the target verification after every code or test edit.
|
|
35
35
|
3. **Refactor:** improve only in-scope structure or readability while target verification stays green; then run the affected suite.
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
Syntax, import/load, no-test, malformed-diff, and wrong-Red-identity failures are generated implementation-artifact rejection.
|
|
38
|
+
A wrong-Red result uses the same bounded artifact-correction path.
|
|
39
|
+
Every artifact rejection receives a finite correction budget shared with the phase's mechanical redispatch budget.
|
|
40
|
+
When the artifact correction budget is exhausted, report `implementation-artifact-delivery-blocked`; it must not automatically return, transition, or route to Design.
|
|
41
|
+
An invalid Red contract is one where Red passes against the preflighted candidate, or where the approved command cannot witness the approved behavior without a substantive behavior, policy, dependency, architecture, scope, write-set, or verification-contract change.
|
|
42
|
+
An invalid Red contract must immediately return the contract defect to Design and must not consume the artifact correction budget.
|
|
43
|
+
Only an invalid Red contract or another substantive behavior, policy, dependency, architecture, scope, write-set, or verification-contract change returns the requirement to Design.
|
|
38
44
|
|
|
39
45
|
### Implement affected-suite repair boundary
|
|
40
46
|
|