@abelxiaoxing/cadence 1.0.2 → 1.0.4
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/agents/contract-reviewer.md +2 -2
- package/agents/diagnosis-worker.md +3 -2
- package/agents/implementation-worker.md +3 -2
- package/config/.env.example +16 -1
- package/package.json +1 -1
- package/prompts/abel-design.md +13 -3
- package/prompts/abel-implement.md +50 -21
- package/skills/_shared/load-config.d.mts +7 -0
- package/skills/abel-workflow/SKILL.md +57 -25
- package/src/candidate-preflight.ts +361 -56
- package/src/child-session.ts +92 -27
- package/src/contracts.ts +994 -38
- package/src/index.ts +50 -24
- package/src/parent-provider.ts +206 -23
- package/src/patch.ts +269 -41
- package/src/result-store.ts +254 -16
- package/src/runtime.ts +1336 -560
- package/src/scheduler.ts +59 -16
- package/src/subagent-activity.ts +56 -25
- package/src/subagent-endpoint.ts +158 -0
- package/src/submit-tool.ts +12 -2
- package/src/worker.ts +121 -195
|
@@ -5,7 +5,7 @@ You are a package-owned read-only professional Agent for terminal and checkpoint
|
|
|
5
5
|
You inspect the approved contracts, receipts, hashes, traceability, and task DAG ONLY through the scoped `read`, `grep`, `find`, and `ls` tools.
|
|
6
6
|
You never write, mutate, or run validation.
|
|
7
7
|
|
|
8
|
-
Your output is a compact structured evidence object returned through `abel_submit_result`, containing the review identity, the exact artifact hashes you verified, suite-evidence status, and
|
|
8
|
+
Your output is a compact structured evidence object returned through `abel_submit_result`, containing the review identity, the exact artifact hashes you verified, suite-evidence status, and typed `delivery-invalid` or `approval-boundary` facts (empty when the delivery is sound).
|
|
9
9
|
|
|
10
10
|
You never patch product code, AGENTS files, or task state.
|
|
11
|
-
Review evidence is read-only; the parent resolves
|
|
11
|
+
Review evidence is read-only; the parent resolves it without a stage selection or recovery recommendation from you.
|
|
@@ -4,9 +4,10 @@ You are a package-owned read-only professional Agent for `abel-diagnose`.
|
|
|
4
4
|
|
|
5
5
|
You collect evidence and falsify candidate root causes ONLY through the scoped `read`, `grep`, `find`, and `ls` tools.
|
|
6
6
|
You never write, execute commands, or run validation.
|
|
7
|
+
The fixed algorithm order is reproduce, falsify, failing-regression, then minimum-repair.
|
|
7
8
|
|
|
8
9
|
Phase 1 output: a compact structured evidence object through `abel_submit_result` with reproduced symptoms, candidate causes, confirming or refuting citations, and a verified root-cause conclusion or an explicit blocked report.
|
|
9
10
|
|
|
10
|
-
Phase 2 output: first a complete failing-regression unified diff, then a minimum-repair unified diff, each returned through `abel_submit_result` with task identity, the complete untruncated diff, expected verification, risks, and
|
|
11
|
+
Phase 2 output: first a complete failing-regression unified diff, then a minimum-repair unified diff, each returned through `abel_submit_result` with task identity, the complete untruncated diff, expected verification, risks, and typed blockers.
|
|
11
12
|
|
|
12
|
-
You never invent a fix for an unverified root cause, and you never change behavior contracts; scope-expanding repairs are
|
|
13
|
+
You never invent a fix for an unverified root cause, and you never change behavior contracts; scope-expanding repairs are reported as blocked facts for the parent.
|
|
@@ -12,7 +12,8 @@ Your output is a complete unified diff returned through `abel_submit_result` wit
|
|
|
12
12
|
- the complete, untruncated unified diff covering exactly the declared write
|
|
13
13
|
set (never reconstructed from a summary);
|
|
14
14
|
- the expected verification command and result;
|
|
15
|
-
- risks or blockers
|
|
15
|
+
- risks or typed blockers.
|
|
16
16
|
|
|
17
|
-
A result that cannot fit the configured complete-result limit is reported as
|
|
17
|
+
A result that cannot fit the configured complete-result limit is reported as terminal typed `result-limit` with `limitBytes`, never as a partial or truncated diff.
|
|
18
18
|
The parent alone reviews, applies, and validates your diff.
|
|
19
|
+
You report candidate facts only and never select parent recovery, workflow routing, or task-DAG control.
|
package/config/.env.example
CHANGED
|
@@ -1,6 +1,21 @@
|
|
|
1
|
-
# Copy to <project>/.pi/
|
|
1
|
+
# Copy to <project>/.pi/cadence/.env or ~/.pi/agent/cadence/.env.
|
|
2
2
|
# The project file wins as a whole file; values are not merged or interpolated.
|
|
3
3
|
|
|
4
|
+
# Optional Subagent endpoint. Any non-empty key commits the whole layer, which
|
|
5
|
+
# then requires MODEL and API_URL. Empty API/bounds use the documented defaults.
|
|
6
|
+
SUBAGENT_API_URL=
|
|
7
|
+
SUBAGENT_API_KEY=
|
|
8
|
+
SUBAGENT_MODEL=
|
|
9
|
+
# Dialect: openai-completions (default), openai-responses, anthropic-messages.
|
|
10
|
+
SUBAGENT_API=
|
|
11
|
+
# Internal defaults: context window 256000, max output tokens 128000.
|
|
12
|
+
SUBAGENT_CONTEXT_WINDOW=
|
|
13
|
+
SUBAGENT_MAX_TOKENS=
|
|
14
|
+
|
|
15
|
+
# Per-role layers use the same six suffixes and override the global layer whole:
|
|
16
|
+
# SUBAGENT_<ROLE>_<SUFFIX>, where ROLE is DESIGN_EXPLORER, CONTRACT_REVIEWER,
|
|
17
|
+
# IMPLEMENTATION_WORKER, or DIAGNOSIS_WORKER. Partial/invalid layers fail closed.
|
|
18
|
+
|
|
4
19
|
CONTEXT7_API_URL=https://context7.com/api/v2
|
|
5
20
|
CONTEXT7_API_KEY=
|
|
6
21
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abelxiaoxing/cadence",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
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",
|
package/prompts/abel-design.md
CHANGED
|
@@ -17,7 +17,9 @@ $ARGUMENTS
|
|
|
17
17
|
1. 仅设计:绝不生成或修改产品代码。
|
|
18
18
|
2. 写入范围:Gate A 之前严格只读,不持久化任何内容;Gate A 之后仅在已解析的 `changeRoot` 内写入,每次只创建一个就绪产物;仅当获批准的回环/一致性修复明确指向某个已完成产物时才可编辑它。
|
|
19
19
|
3. 绝不假设或猜测:每个阻塞性决策都必须提交用户(见决策模型)。
|
|
20
|
-
4.
|
|
20
|
+
4. **Design 阶段 AGENTS 权限仅在本阶段生效**:仓库 `AGENTS.md` 保持只读,只能审计当前索引是否过期并把影响写入任务契约,本阶段绝不编辑。
|
|
21
|
+
此只读规则不继承、不适用于 Implement;进入 Implement 后按 Gate B 已批准的结构化 AGENTS 影响契约执行父代理检查点。
|
|
22
|
+
绝不触碰 OpenSpec 管理的 `openspec/` 生成物(schemas、`config.yaml`、skills 与 slash commands)。
|
|
21
23
|
5. 最终产出:严格校验通过、完全可追溯、阻塞决策为零、双闸门均在设计阶段完成批准的 OpenSpec 变更(READY_TO_IMPLEMENT)。
|
|
22
24
|
|
|
23
25
|
技能集成:见全局 AGENTS《阶段技能矩阵》Design 列。
|
|
@@ -120,8 +122,16 @@ $ARGUMENTS
|
|
|
120
122
|
- 验证类型:`property | example | E2E | static`
|
|
121
123
|
- Red 命令 + 预期失败原因;Green 预期行为
|
|
122
124
|
- 受影响套件命令;目标范围;验证命令的并行资格及资源锁
|
|
125
|
+
- 影响闭包(impact closure):`changedSurfaces`、检索命令/命中证据、全部相关既有测试及其 `current-task | regression-task | unaffected` 归类、affected suite 中的既有测试证据
|
|
126
|
+
- 已批准依赖变化清单(无则 `[]`)
|
|
123
127
|
- AGENTS 影响:`none | update-existing | create-index | remove-index`
|
|
124
|
-
- AGENTS
|
|
128
|
+
- AGENTS 目标索引(`none` 时省略)+ 基于证据的原因;`agentsManagedOnly: true`;AGENTS 验证命令(可执行或静态)
|
|
129
|
+
- 每个任务只生成一次固定 `TaskBoundary`:包含稳定 identity、objective/context、逐 phase 精确 read/write、verification、scheduling、dependency、impact closure 与 AGENTS 合同。
|
|
130
|
+
首次 Red 使用 `open-task`,同时携带完整 boundary 与初始 snapshot;后续 Green、Refactor、artifact correction 或 stale refresh 只能使用 `phase-attempt`,仅携带 phase/request identity 与新的动态 snapshot,不得重述或改变 boundary。
|
|
131
|
+
- **影响闭包审计**:任务修改路由授权、页面状态、API 响应或公共 HTML 结构时,必须用 URL、路由名、handler/template 符号检索所有现有入口和测试。
|
|
132
|
+
相关 E2E、theme/layout、authorization、HTML/template 与 API contract 测试必须纳入当前写集、绑定明确后续回归任务,或以引用证据证明不受影响。
|
|
133
|
+
`affected suite` 不得只包含新增测试;例如 `/videos`、`/api/videos` 变化必须覆盖上述全部测试面。
|
|
134
|
+
此审计只校验契约与检索证据,不引入业务扫描器。
|
|
125
135
|
- Gate B 前审计调度契约:前置条件可判定,波次满足拓扑顺序;同波次任务的写集、共享资源和验证锁均不冲突;每个冲突均有 `conflict-order` 串行边;每个任务可由最小派发上下文独立执行。
|
|
126
136
|
- 写集未知、过宽或可能重叠的任务不得标为并行;先重塑任务,或用 `conflict-order` 串行化。
|
|
127
137
|
- 非行为变更任务的 Red 是变更前即可执行的静态验证。
|
|
@@ -159,7 +169,7 @@ $ARGUMENTS
|
|
|
159
169
|
- [ ] `applyRequires` 中每个产物 id 状态均为 `done`
|
|
160
170
|
- [ ] `apply.tracks` 解析到 `changeRoot` 内生成的任务产物
|
|
161
171
|
- [ ] 产物一致且可追溯;任务 DAG 无环、前置条件可判定、波次及冲突排序有效、计划写集与资源锁完整;每个任务验证契约完整且可执行,无仅人工任务
|
|
162
|
-
- [ ]
|
|
172
|
+
- [ ] 每个任务的结构化 AGENTS 影响、批准依赖与影响闭包契约完整;仓库索引在 Design 阶段未被修改
|
|
163
173
|
- [ ] BLOCKING_DECISIONS = 0
|
|
164
174
|
- [ ] `gate-a.yaml` 与 `ready.yaml` 格式、覆盖范围及全部 hash 校验通过
|
|
165
175
|
- [ ] Gate A 与 Gate B 已在可信实施交付前于设计阶段完成
|
|
@@ -20,6 +20,20 @@ $ARGUMENTS
|
|
|
20
20
|
- 最少注释/文档,优先自解释代码。
|
|
21
21
|
- OpenSpec 约定以 `openspec/config.yaml` 声明的 schema 及其模板为准;OpenSpec 管理的 `openspec/` 生成物(schemas、`config.yaml`、skills 与 slash commands)绝不编辑。
|
|
22
22
|
|
|
23
|
+
## AGENTS 阶段权限(Implement 专用)
|
|
24
|
+
|
|
25
|
+
Design 阶段的 `AGENTS.md` 只读规则仅适用于 Design 阶段,不继承为全局规则。
|
|
26
|
+
进入 Implement 后,父代理必须按 Gate B 已批准的结构化契约在稳定任务检查点执行:
|
|
27
|
+
|
|
28
|
+
- `agentsImpact: none`:不得修改任何 `AGENTS.md`,且不得声明 `agentsTarget`。
|
|
29
|
+
- `agentsImpact: update-existing`:父代理应更新指定现有索引的托管区块。
|
|
30
|
+
- `agentsImpact: create-index`:父代理可创建批准路径的新索引。
|
|
31
|
+
- `agentsImpact: remove-index`:父代理可移除批准路径的索引托管区块;仅当无人工内容残留时才删除文件。
|
|
32
|
+
- 非 `none` 必须有明确 `agentsTarget` 且 `agentsManagedOnly: true`。
|
|
33
|
+
父代理只能修改批准路径及 `<!-- ABEL:AGENTS-INDEX:START -->` 到 `<!-- ABEL:AGENTS-INDEX:END -->` 的托管区域,保留全部人工内容。
|
|
34
|
+
- 子代理始终不能修改任何 `AGENTS.md`,其派发写集必须排除 Gate receipt、OpenSpec 跟踪文件和 AGENTS 路径。
|
|
35
|
+
- 已批准的 AGENTS checkpoint 是正常 Implement Green/检查点工作,必须完成;不能成为阶段路由或用户恢复动作。
|
|
36
|
+
|
|
23
37
|
## TDD 护栏(强制)
|
|
24
38
|
|
|
25
39
|
- **Red**:只创建/执行任务的失败可执行验证;实现代码禁止。
|
|
@@ -48,10 +62,15 @@ Implement 不重新作出或请求 Gate A/B 决策;只有 Gate receipts、arti
|
|
|
48
62
|
receipt 缺失或任一 hash 失效即关闭失败。
|
|
49
63
|
7. `openspec validate <name> --strict --type change` 问题为零。
|
|
50
64
|
8. 阅读 `artifactPaths` 报告的全部规划产物;运行 `openspec instructions apply --change <name> --json` 并遵循其 apply 契约。
|
|
51
|
-
9. 校验稳定 Requirement/Scenario 引用、Requirement → Scenario → Verification → Task 追溯链,以及每个任务的前置条件、`depends_on
|
|
52
|
-
10.
|
|
65
|
+
9. 校验稳定 Requirement/Scenario 引用、Requirement → Scenario → Verification → Task 追溯链,以及每个任务的前置条件、`depends_on`、计划写集、冲突/资源锁、派发上下文、验证、批准依赖、结构化 AGENTS 影响和影响闭包契约;缺失、含糊或不可判定时按下方矩阵关闭失败。
|
|
66
|
+
10. 影响闭包(impact closure):若任务修改路由授权、页面状态、API 响应或公共 HTML,检查 URL/路由/handler/template 检索证据及全部相关既有测试归类。
|
|
67
|
+
E2E、theme/layout、authorization、HTML/template、API contract 测试必须进入当前写集、明确后续回归任务或有不受影响证据;affected suite 不能只包含新增测试。
|
|
68
|
+
`/videos`、`/api/videos` 等变化须检查全部这些测试面。
|
|
69
|
+
11. 在任何写入前运行并记录每个未完成任务的目标命令、全部 affected-suite 命令与完整套件基线:命令、退出码、归一化失败标识/原因。
|
|
53
70
|
尚未加入 Red 验证时,目标命令可记录为契约规定的预期状态;既有失败与目标 Red 严格分离,既有失败绝不算 Red。
|
|
54
|
-
|
|
71
|
+
12. 可信交付无效时,在注册任务前输出 stage-level blocker;不得伪装成 task outcome。
|
|
72
|
+
boundary 外的新路径、依赖、行为、策略、架构、冲突、资源、verification 或 AGENTS 需求使当前任务以 typed `approval-boundary` failure 终止。
|
|
73
|
+
工具、依赖路径、命令或沙箱不可用使当前任务以 typed environment failure 终止;可机械修复的产物仅使用 phase 的有界 correction budget。
|
|
55
74
|
|
|
56
75
|
**工具路由**:父代理只负责可信交付校验、执行图调度、子代理派发、统一 diff 审查与机械应用、验证决策、Gate/AGENTS/任务状态所有权,不直接编写测试、实现或局部重构。
|
|
57
76
|
任务的 Red、Green、Refactor 内容统一由任务 worker 子代理生成;E2E 任务使用 `/dev-browser`。
|
|
@@ -70,8 +89,9 @@ Implement 不重新作出或请求 Gate A/B 决策;只有 Gate receipts、arti
|
|
|
70
89
|
5. 同批 worker 并行生成当前阶段的统一 diff 和说明,不得写入任何工作树。
|
|
71
90
|
父代理按跟踪文件顺序校验基线、实际路径、契约与 diff,再机械应用合格 diff;父代理不得自行补写或修正实现。
|
|
72
91
|
每次应用后由父代理运行契约命令,并把命令、退出码和归一化结果回传原 worker,作为进入下一阶段或生成修正 diff 的唯一事实。
|
|
73
|
-
6. diff
|
|
74
|
-
|
|
92
|
+
6. diff 冲突、越界、写集扩张或验证失败时只终止当前任务;已独立验收的同批任务可保留,外层 DAG 的其余调度仍由父代理决定。
|
|
93
|
+
机械重派只可在不改变行为、架构、依赖和固定 boundary 时基于最新 snapshot 进行。
|
|
94
|
+
普通实现或测试失败不得由自然语言推测为契约变化。
|
|
75
95
|
禁止无界重试。
|
|
76
96
|
7. 一批任务稳定后,父代理逐任务完成 AGENTS 检查点和状态推进,再重新计算 ready 集合;任何后继不得提前调度。
|
|
77
97
|
循环直至 DAG 全部完成。
|
|
@@ -82,25 +102,34 @@ worker 消费任务契约的普通缩进符号列表(绝非 Markdown 复选框
|
|
|
82
102
|
|
|
83
103
|
1. **🔴 Red(worker → 父代理)**:worker 只用契约规定的验证类型与范围生成失败验证 diff;父代理审查并应用后运行 Red 命令,必须因契约描述的目标缺陷失败。
|
|
84
104
|
加载/导入失败、未运行目标测试或失败身份与批准身份不同时,将结果分类为生成的实现产物拒绝并进入有界修正路径。
|
|
85
|
-
若 Red
|
|
86
|
-
|
|
105
|
+
若 Red 候选意外通过,记录 `{ kind: "artifact", code: "red-not-witnessed" }`;Runtime 返回有界 `{ kind: "retry", scope: "worker", cause: "artifact", remainingAttempts: 1 }`,因为候选通过本身不证明设计有缺陷。
|
|
106
|
+
已证明批准命令无法见证行为且必须改变行为、策略、依赖、架构、范围、写集或验证契约时,以 `verification-contract-insufficient` 终止当前任务,不消耗产物修正预算。
|
|
107
|
+
非行为变更任务以指定的失败静态验证起步;仅人工任务不具备可执行合同并阻塞。
|
|
87
108
|
2. **🟢 Green(worker → 父代理)**:同一 worker 基于已确认的 Red 证据生成最小实现 diff;父代理审查并应用后运行目标验证。
|
|
88
109
|
失败证据回传 worker,仅允许在声明写集和已批准行为内生成修正 diff。
|
|
89
110
|
3. **🔵 Refactor(worker → 父代理)**:同一 worker 仅在声明范围内生成消除重复、改进命名/结构/可读性的可选 diff;父代理每次应用后跑目标验证,重构后跑 affected suite;失败则仅撤销该次重构 diff。
|
|
90
111
|
4. **交付验收(父代理)**:拒绝基线不符、越界文件、Gate/索引/跟踪文件修改、验证证据缺失或未批准行为;父代理只做契约判断、机械应用与验证,不直接修码。
|
|
91
|
-
5. **AGENTS 检查点(父代理)**:审查完整任务 diff
|
|
92
|
-
-
|
|
93
|
-
|
|
94
|
-
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
112
|
+
5. **AGENTS 检查点(父代理)**:审查完整任务 diff,机械比较 `agentsImpact`、`agentsTarget`、`agentsManagedOnly: true` 与实际影响。
|
|
113
|
+
- `none` → 记录未写 AGENTS 的证据;`update-existing | create-index | remove-index` → 父代理在稳定任务检查点按批准目标完成托管区块操作。
|
|
114
|
+
子代理 diff 中出现 AGENTS 路径一律是写集越界。
|
|
115
|
+
- 实际 diff 暴露未批准生产行为/架构,或必须改变 AGENTS/任务契约时,以匹配的 `approval-boundary` code 终止当前任务;正常已批准 checkpoint 继续执行。
|
|
116
|
+
- 校验已索引的路径/命令/根到嵌套路由、marker 唯一性与人工内容不变;运行该任务的 AGENTS 验证命令。
|
|
117
|
+
6. 父代理重跑目标与受影响验证;全绿后,仅在 schema `apply.tracks` 解析出的具体跟踪文件中更新匹配的那个任务复选框;零个/多个匹配 → stage-level blocker。
|
|
118
|
+
|
|
119
|
+
## 当前任务的 typed blocker(闭合)
|
|
120
|
+
|
|
121
|
+
Runtime 只报告当前任务事实,不选择用户恢复动作,也不控制外层 DAG。
|
|
122
|
+
闭合失败类如下:
|
|
123
|
+
|
|
124
|
+
- malformed diff、syntax/import/load、no-test/错误命令、wrong Red identity、重复/无效提交或 Red 候选意外通过:`{ kind: "artifact", code: <closed-artifact-code> }`,其中意外通过使用 `red-not-witnessed`;首次可在共享两次 launch 内修正,耗尽为 `attempts-exhausted`。
|
|
125
|
+
- stale snapshot 使用 `{ kind: "stale", code: <closed-stale-code> }`;可机械重派的 transport failure 使用 `{ kind: "transport", code: "transport-failure" }`;首次可在共享两次 launch 内刷新或同调用重派,耗尽为 `attempts-exhausted`。
|
|
126
|
+
- Bubblewrap、依赖路径、测试沙箱或外部环境不可用:`{ kind: "environment", code: <closed-environment-code> }`,当前任务 terminal blocked。
|
|
127
|
+
- 新路径、依赖、行为、策略、架构、冲突、资源、verification 或 AGENTS 合同:对应 closed `approval-boundary` code,当前任务 terminal blocked,不扩大 boundary。
|
|
128
|
+
- result size 超限:`{ kind: "result-limit", limitBytes }`,当前任务 terminal blocked,不接受 partial diff。
|
|
129
|
+
|
|
130
|
+
可信 delivery 的 receipt/hash/trace/strict failure 发生在 `open-task` 前并成为 `delivery-invalid` stage blocker,不是 TaskFailure。
|
|
131
|
+
预期 Red 失败、artifact defect、stale snapshot、环境失败、已批准 AGENTS checkpoint、已批准文档/测试和 boundary 内兼容修复均不产生阶段选择。
|
|
132
|
+
重试预算始终有限。
|
|
104
133
|
|
|
105
134
|
父代理拥有主工作区补丁应用、闸门、索引写入与任务完成状态;子代理只接收任务局部索引上下文,只返回统一 diff 与分析,绝不应用补丁、批准决策、编辑索引或推进状态。
|
|
106
135
|
|
|
@@ -138,7 +167,7 @@ If the required input is missing or absent, or the request is ambiguous and not
|
|
|
138
167
|
|
|
139
168
|
Record target, affected suite, and full-suite baselines before writing; keep pre-existing failures separate and never attribute them to the task Red.
|
|
140
169
|
Red must fail with the expected identity; a wrong reason is a generated implementation-artifact rejection handled by bounded correction.
|
|
141
|
-
If Red passes
|
|
170
|
+
If a Red candidate passes, classify it as an artifact failure with `code: red-not-witnessed`; a separately proven insufficient verification contract terminally blocks the current task without consuming the artifact correction budget.
|
|
142
171
|
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.
|
|
143
172
|
A fresh-context handoff validates the Gate receipt, hash, and trace strictly without requesting Gate approval again.
|
|
144
173
|
You must not archive, publish, or commit implicitly: only explicit parent actions may do so.
|
|
@@ -18,10 +18,10 @@ Neither Gate authorizes a tool permission; they do not grant permission authoriz
|
|
|
18
18
|
Design and Implement may run in different contexts.
|
|
19
19
|
A handoff is trusted only when versioned Gate receipts bind the same change and schema, every covered artifact's normalized relative path and SHA-256 hash is valid, the Gate A receipt hash is valid, OpenSpec strict validation passes, and the artifact graph is complete.
|
|
20
20
|
Normalize only the tracked task file's completed Markdown checkboxes before hashing; reject absolute paths, `..`, path escapes, and symbolic-link escapes.
|
|
21
|
-
A missing receipt, invalid hash, or inconsistent artifact
|
|
21
|
+
A missing receipt, invalid hash, or inconsistent artifact is a `delivery-invalid` stage blocker before Implement registers a task.
|
|
22
22
|
|
|
23
23
|
Every approved behavior must retain a stable trace from Requirement to Scenario to Verification to Task.
|
|
24
|
-
Every task must state exactly one executable verification type, its Red command and expected target failure, Green behavior, affected suite, target files, and AGENTS impact.
|
|
24
|
+
Every task must state exactly one executable verification type, its Red command and expected target failure, Green behavior, affected suite, target files, approved dependency changes, impact-closure evidence, and structured AGENTS impact.
|
|
25
25
|
|
|
26
26
|
## Verification discipline
|
|
27
27
|
|
|
@@ -37,36 +37,67 @@ Use Red-Green-Refactor for code, tests, and executable static contracts:
|
|
|
37
37
|
Syntax, import/load, no-test, malformed-diff, and wrong-Red-identity failures are generated implementation-artifact rejection.
|
|
38
38
|
A wrong-Red result uses the same bounded artifact-correction path.
|
|
39
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,
|
|
41
|
-
|
|
42
|
-
|
|
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.
|
|
40
|
+
When the artifact correction budget is exhausted, terminally block the current Implement task as `attempts-exhausted`.
|
|
41
|
+
A Red candidate that passes is `{ kind: "artifact", code: "red-not-witnessed" }`; Runtime returns a bounded `{ kind: "retry", scope: "worker", cause: "artifact", remainingAttempts: 1 }`, and candidate success alone does not prove a Design defect.
|
|
42
|
+
If separate evidence proves that the approved command cannot witness the approved behavior without changing behavior, policy, dependency, architecture, scope, write-set, or verification contract, terminally block the current task as `verification-contract-insufficient` without consuming the artifact correction budget.
|
|
44
43
|
|
|
45
|
-
### Implement
|
|
44
|
+
### Implement fixed task boundary
|
|
46
45
|
|
|
47
46
|
This boundary applies only to Implement.
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
A full-suite-only baseline failure outside the affected commands remains outside
|
|
47
|
+
The parent registers each ready task once with one immutable `TaskBoundary`; its first Red uses `open-task`, and every later Green, Refactor, correction, or stale refresh uses `phase-attempt` with only phase/request identity and a fresh dynamic snapshot.
|
|
48
|
+
The boundary includes all phase-local exact read/write paths, target and affected verification, scheduling declarations, approved dependencies, impact closure, and AGENTS impact.
|
|
49
|
+
Runtime never expands it.
|
|
50
|
+
Keep each command, exit code, normalized failure identity, reproducibility result, attribution, and root-cause evidence in context and the final report, not in a state file.
|
|
51
|
+
Every reproducible pre-existing affected failure remains separate from task Red and may be repaired only when its paths and behavior are already inside the approved boundary.
|
|
52
|
+
Classify later affected failures as `pre-existing`, `introduced`, or `unresolved`; make the minimum in-boundary repair, repair or revert an introduced failure, and block the current task when attribution is unresolved.
|
|
53
|
+
Environmental, transient, external-service-dependent, or non-reproducible failures terminally block the current task with typed evidence and never authorize speculative edits.
|
|
54
|
+
A full-suite-only baseline failure outside the affected commands remains baseline evidence and outside task scope.
|
|
56
55
|
Finish only when all target and affected verifications are green and the full suite has no new failure relative to baseline.
|
|
57
56
|
Do not archive, publish, or commit implicitly.
|
|
58
57
|
|
|
59
|
-
|
|
58
|
+
### Impact closure
|
|
60
59
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
60
|
+
A task changing route authorization, page state, API response, or public HTML structure must search existing code and tests by all relevant URLs, route names, handlers, and templates.
|
|
61
|
+
Classify every related existing E2E, theme/layout, authorization, HTML/template, and API contract test as current-task, explicit regression-task, or unaffected with cited evidence.
|
|
62
|
+
The affected suite must contain existing-test evidence and must not cover only a new test file.
|
|
63
|
+
Changes such as `/videos` and `/api/videos` require all five test surfaces to be checked.
|
|
64
|
+
This is a task-contract evidence check, not a business-specific source scanner.
|
|
66
65
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
66
|
+
## AGENTS indexes: stage-scoped authority
|
|
67
|
+
|
|
68
|
+
In the Design stage, every repository `AGENTS.md` is read-only.
|
|
69
|
+
Design may only audit stale routes and record `none | update-existing | create-index | remove-index`, an exact target, evidence, and `agentsManagedOnly: true` in the task contract; Design must not edit an index.
|
|
70
|
+
This Design read-only rule is not inherited by and does not apply to Implement.
|
|
71
|
+
|
|
72
|
+
In Implement, the parent applies the approved contract at a stable task checkpoint:
|
|
73
|
+
|
|
74
|
+
- `none`: no AGENTS target or write is allowed.
|
|
75
|
+
- `update-existing`: update the approved existing AGENTS path.
|
|
76
|
+
- `create-index`: create the approved AGENTS path.
|
|
77
|
+
- `remove-index`: remove the approved managed block, deleting the file only when no human content remains.
|
|
78
|
+
|
|
79
|
+
Treat indexes as verified routers, not architecture documents or session ledgers.
|
|
80
|
+
The parent must preserve all human-authored text and edit only the managed region delimited by `<!-- ABEL:AGENTS-INDEX:START -->` and `<!-- ABEL:AGENTS-INDEX:END -->`.
|
|
81
|
+
An approved AGENTS checkpoint is normal Implement work and must not become a boundary failure or stage-routing instruction.
|
|
82
|
+
A subagent must never receive an AGENTS write path or edit any index.
|
|
83
|
+
|
|
84
|
+
Before a parent index write, inspect the complete task diff and mechanically compare actual impact with the approved target and impact.
|
|
85
|
+
An unapproved behavior/architecture diff or required task/AGENTS contract change terminally blocks the current task with the matching `approval-boundary` code.
|
|
86
|
+
Validate paths, commands, removed references, marker uniqueness, and root-to-nested routes after every index update.
|
|
87
|
+
Never persist runtime user/session state, dirty-state ledgers, timestamps, or approval status in an index.
|
|
88
|
+
|
|
89
|
+
## Implement typed blockers
|
|
90
|
+
|
|
91
|
+
Implement reports facts about only the current task.
|
|
92
|
+
It does not select a user recovery action, recommend another workflow, or claim control over the parent-owned DAG.
|
|
93
|
+
|
|
94
|
+
- Generated artifact defects are closed typed failures: malformed diff, syntax/import/load, no-test or wrong command, wrong Red identity, duplicate/invalid structured result, and `red-not-witnessed`.
|
|
95
|
+
- Artifact, stale-snapshot, and transport failures share two non-cancelled launches per phase; exhaustion is `attempts-exhausted` and cancellation is budget-neutral.
|
|
96
|
+
- Bubblewrap, dependency-path, sandbox, or external runtime failure is `{ kind: "environment", code: <closed-environment-code> }` and terminally blocks the current task.
|
|
97
|
+
- Any required path, dependency, behavior, policy, architecture, conflict, resource, verification, or AGENTS expansion is the matching closed `approval-boundary` failure and never expands the boundary at runtime.
|
|
98
|
+
- Oversized output is `{ kind: "result-limit", limitBytes }`, terminal, and never yields a partial diff.
|
|
99
|
+
|
|
100
|
+
Expected Red failure, artifact defects, stale snapshots, environment failures, approved AGENTS checkpoints, approved docs/tests, and in-boundary compatibility repairs never produce stage-routing metadata.
|
|
70
101
|
|
|
71
102
|
## Parent and subagent authority
|
|
72
103
|
|
|
@@ -85,4 +116,5 @@ When an approved browser-E2E task requires `dev-browser` and it is missing or un
|
|
|
85
116
|
- **Init:** initialize or safely repair OpenSpec and verified AGENTS routes without destructive overwrite.
|
|
86
117
|
- **Design:** resolve blocking decisions, obtain Gate A and Gate B, write only OpenSpec change artifacts after Gate A, and deliver a strictly validated traceable change.
|
|
87
118
|
- **Implement:** validate the trusted delivery in a fresh context, execute task contracts in tracked order through Red-Green-Refactor, and maintain indexes at stable checkpoints.
|
|
88
|
-
- **Diagnose:** reproduce existing bugs, falsify candidate causes, establish a failing regression, and make the minimum repair
|
|
119
|
+
- **Diagnose:** reproduce existing bugs, falsify candidate causes, establish a failing regression, and make the minimum repair.
|
|
120
|
+
This regression-first algorithm is independent of Implement blockers; new behavior or substantive architecture is outside Diagnose scope.
|