@peterxiaoyang/superspec 0.1.0 → 0.1.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 +175 -24
- package/dist/src/cli.js +2 -2
- package/dist/src/cli_args.js +18 -12
- package/dist/src/gates.js +11 -16
- package/dist/src/i18n.d.ts +21 -0
- package/dist/src/i18n.js +659 -0
- package/dist/src/init_cli.d.ts +25 -0
- package/dist/src/init_cli.js +91 -15
- package/dist/src/openspec.d.ts +17 -0
- package/dist/src/openspec.js +89 -3
- package/dist/src/project_init.d.ts +28 -1
- package/dist/src/project_init.js +69 -21
- package/dist/src/util.d.ts +21 -1
- package/dist/src/util.js +105 -5
- package/package.json +1 -1
- package/templates/workflow/prompts/architect.md +62 -55
- package/templates/workflow/prompts/code-reviewer.md +84 -77
- package/templates/workflow/prompts/critic.md +42 -35
- package/templates/workflow/prompts/test-engineer.md +73 -66
- package/templates/workflow/prompts/verifier.md +33 -26
- package/templates/workflow/skills/superspec-apply/SKILL.md +23 -11
- package/templates/workflow/skills/superspec-archive/SKILL.md +14 -2
- package/templates/workflow/skills/superspec-explore/SKILL.md +32 -20
- package/templates/workflow/skills/superspec-propose/SKILL.md +39 -27
- package/templates/workflow/skills/superspec-review/SKILL.md +52 -40
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: superspec-explore
|
|
3
|
-
description: "1
|
|
3
|
+
description: "1.新需求刚开始时用:先把目标、范围、风险和现有代码事实弄清楚,产出探索记录(`discovery.md`);这一步只探索,不写正式方案,也不改代码。"
|
|
4
|
+
metadata:
|
|
5
|
+
author: SuperSpec
|
|
6
|
+
source: SuperSpec
|
|
4
7
|
---
|
|
5
8
|
|
|
6
9
|
# SuperSpec Explore
|
|
@@ -10,13 +13,22 @@ description: "1.探索并澄清需求,进入 SuperSpec propose 前完成 OpenS
|
|
|
10
13
|
- 默认使用简体中文撰写所有人类可读产物、分析、报告、说明和 OpenSpec 文档正文。
|
|
11
14
|
- 保留命令、路径、JSON 字段、gate 名、task/test id、代码标识符和外部 API 名称的原文。
|
|
12
15
|
- 当 OpenSpec 模板要求固定标题或字段时,保留模板结构,只将正文内容写成中文。
|
|
16
|
+
- 对话窗口里的解释、问题说明、总结、提问和下一步说明必须使用中文;除命令、路径、字段名、代码标识符外,不要夹带英文说明词。
|
|
17
|
+
- 对话窗口、AskUserQuestion 文案、进度更新和最终总结不得裸露内部证据种类、字段名或 reason code;用户确认记录、审查问题记录、审查轮次编号、问题唯一标识等都只用中文业务说法。原始协议名只允许写在证据 JSON、代码、测试、精确命令输出或用户明确要求的诊断片段中。
|
|
18
|
+
- 本 skill 文档中的内部协议名只用于落盘证据或运行 guard;写给用户时必须先翻译成中文业务动作,例如“记录用户确认”“记录审查问题”“完成最终审查判断”。
|
|
19
|
+
- 向用户转述 guard / review 输出时,不要直接贴英文 `message`、`next_allowed_actions` 或英文模板标题;应改写为中文,并仅在需要定位内部协议时保留英文 code/command 于反引号中。
|
|
20
|
+
|
|
21
|
+
## 命令执行 / Shell
|
|
22
|
+
|
|
23
|
+
- Windows PowerShell 中执行 npm 全局 bin 时,必须显式使用 `.cmd` shim:`superspec.cmd ...`、`openspec.cmd ...`;不要运行 `superspec.ps1` 或 `openspec.ps1`。
|
|
24
|
+
- macOS、Linux、Git Bash、cmd.exe 或其他不会优先拦截 `.ps1` 的 shell 中,继续使用文档中的 `superspec ...`、`openspec ...` 命令。
|
|
13
25
|
|
|
14
26
|
在 init 之后、编写 OpenSpec proposal package 之前使用本 skill。
|
|
15
27
|
|
|
16
28
|
## 边界 / Boundaries
|
|
17
29
|
|
|
18
|
-
- 先桥接 repo-local OpenSpec explore skill:读取 `.codex/skills/openspec-explore/SKILL.md
|
|
19
|
-
-
|
|
30
|
+
- 先桥接 repo-local OpenSpec explore skill:读取 `.codex/skills/openspec-explore/SKILL.md`,并按它的探索方式工作:像需求探索搭档一样帮助用户澄清目标、调查代码、比较方案和暴露风险,不急着下结论。
|
|
31
|
+
- 相比 OpenSpec 的原始探索模式,SuperSpec 增加了更严格的边界:**只思考和调查,不实现**。主流程可以读代码、搜索代码,并把发现写成探索记录(`discovery.md`)作为 evidence;但不能修改应用代码,也不能在本阶段编写 OpenSpec planning artifacts。如果调查过程中发现需要沉淀 proposal/specs/design/tasks,请先记录到探索记录(`discovery.md`),再交给 `superspec-propose`,由 `openspec instructions` 生成 OpenSpec artifacts。
|
|
20
32
|
- Explore 只产出需求和上下文证据;不完成 OpenSpec proposal、specs、design 或 tasks。
|
|
21
33
|
- 需求 critique evidence 必须来自 repo-local `critic` native subagent。
|
|
22
34
|
- v1 evidence 是 audit-only/self-reported;除非有 OpenSpec facts 支撑,不要把它描述成强制运行时事实。
|
|
@@ -24,20 +36,20 @@ description: "1.探索并澄清需求,进入 SuperSpec propose 前完成 OpenS
|
|
|
24
36
|
## 范围收敛透明度 / Scope Transparency
|
|
25
37
|
|
|
26
38
|
- Agent 可以在 explore/propose 前基于证据收敛范围,但不得静默收窄用户目标。
|
|
27
|
-
-
|
|
39
|
+
- 当用户目标、现有实现或合理利益相关方预期自然覆盖多个层级、模块、入口、流程、角色或行为,而探索记录、proposal 或 design 只准备覆盖其中一部分时,必须显式记录纳入范围、排除范围、排除理由、已知或可合理推断的影响,以及仍未知但会影响范围判断的风险。
|
|
28
40
|
- 不能把“本轮先做最小改动”“默认不处理其他模块”“按当前实现猜测无影响”作为隐式排除理由;这些都必须写成可审查的范围决策。
|
|
29
|
-
- `critic`
|
|
41
|
+
- `critic` 必须拦住未说明的关键范围收窄:如果范围收敛会改变用户合理预期、验收标准、兼容承诺、测试边界或后续实现风险,而 artifact 没有说明纳入/排除/理由/影响,则不能通过 explore/propose handoff。
|
|
30
42
|
|
|
31
|
-
##
|
|
43
|
+
## 审查问题确认循环 / Review Disclosure Loop(DISC Phase 1)
|
|
32
44
|
|
|
33
|
-
|
|
45
|
+
多角色审查发现的问题**不允许主流程自行处理掉**。关键问题包括:范围(`scope`)、非目标(`non_goal`)、验收标准(`acceptance`)、业务语义(`business_semantics`)、设计边界(`design_boundary`)。这些问题必须按原文展示给用户,拿到用户确认后才能继续。
|
|
34
46
|
|
|
35
|
-
- critic review evidence 必须携带 `review_round_id`(形如 `explore_complete-r<N>`,从 r1 连续编号)和结构化 `findings[]`:每条 finding 含 `finding_id`、`finding_uid`(`<gate>:<evidence_id>:<finding_id>`)、`finding_type`(`blocker|scope_risk|open_question|agent_assumption|non_blocking_finding`)、`category`、`material_categories[]
|
|
36
|
-
-
|
|
37
|
-
-
|
|
38
|
-
-
|
|
39
|
-
-
|
|
40
|
-
- finding history 是 append-only:旧 blocker 不会因 clean
|
|
47
|
+
- critic review evidence 必须携带 `review_round_id`(形如 `explore_complete-r<N>`,从 r1 连续编号)和结构化 `findings[]`:每条 finding 含 `finding_id`、`finding_uid`(`<gate>:<evidence_id>:<finding_id>`)、`finding_type`(`blocker|scope_risk|open_question|agent_assumption|non_blocking_finding`)、`category`、`material_categories[]`、关键问题的 `decision_scope_key`,以及 reviewer 原话 `summary`。分类字段由 reviewer 产生,主流程不得改写(P0-2)。
|
|
48
|
+
- 每轮审查后主流程写 `kind:"main_review_digest"` evidence(`created_by:"main-thread"`),逐条覆盖该轮所有 findings:身份字段与 `summary` **逐字拷贝**原始 finding,给出 `disposition`(`fixed|false_positive|accepted_deviation|user_decided|needs_user_decision`)、`rationale`、`route`/`route_reason` 和每种处理结果的证据;`target_refs` 固定记录当前探索记录内容;`source_review_evidence_refs` 引用本轮全部 role review;round>1 时 `previous_digest_refs` 串接上一轮记录。
|
|
49
|
+
- **关键 finding 一律走用户确认点**:内部先写审查问题记录 evidence(JSON kind 为 `main_review_digest`,`status:"blocked"` + `needs_user_decision`),然后把 finding 原文 + A/B/C/D 选项 +(每个选项对范围、非目标、验收标准、测试边界的影响)呈现给用户。用户确认记录 evidence 的 JSON kind 为 `user_review_decision`(`created_by:"user"`,`finding_uids` 精确到 `finding_uid`,`decision_scope_key`、`material_categories[]`、`confirmed_refs` 固定记录用户看到的 blob)。D 选项必须保留 `user_text` 原文并填 `structured_decision`(scope/non_goals/acceptance_impact/test_impact + requires_artifact_update/requires_rereview 布尔值)。
|
|
50
|
+
- 用户确认导致探索记录修改后:更新 artifact → supersede 过期的旧轮 review → 重跑 critic(round k>1 的 prompt **必须**内嵌工具生成的问题清单,由 `render_finding_ledger` 生成,guard 逐字校验)→ 写新一轮 `main_review_digest`(最终处理结果引用 `user_decision_refs`,artifact 修改时附 `artifact_update_refs`)。
|
|
51
|
+
- 关键 finding 的任何最终处理结果(含 `fixed`/`false_positive`)必须引用 `user_decision_refs[]`、有效 `standing_authorization_refs[]` 或 `baseline_decision_refs[]`;standing authorization 只能由用户创建、按 category 授权、永不覆盖 blocker。
|
|
52
|
+
- finding history 是 append-only:旧 blocker 不会因 clean 重审而消失,必须拿到最终处理结果;同一 gate 超过 3 轮仍未处理完成时停止迭代,把未决 findings 整体升级给用户(`escalate_round_budget`)。
|
|
41
53
|
- 历史 change 的旧式 critic evidence(无 `review_round_id`/`findings[]`)维持原判定口径,不被追溯 block。
|
|
42
54
|
|
|
43
55
|
## 步骤 / Steps
|
|
@@ -53,18 +65,18 @@ description: "1.探索并澄清需求,进入 SuperSpec propose 前完成 OpenS
|
|
|
53
65
|
openspec list --json
|
|
54
66
|
openspec status --change "<change>" --json # changeRoot / artifactPaths / actionContext for grounding
|
|
55
67
|
```
|
|
56
|
-
3.
|
|
57
|
-
4.
|
|
58
|
-
5. 启动 repo-local `critic` native subagent(round r1),审查歧义、遗漏场景、矛盾、scope risk 和范围收敛透明度;如存在未显式说明的关键范围收窄,critic 必须 block。critic
|
|
59
|
-
6.
|
|
68
|
+
3. 按 OpenSpec 的探索方式工作,同时遵守 SuperSpec 输出边界:可以自由调查和澄清,但本阶段只写 SuperSpec sidecar evidence。
|
|
69
|
+
4. 主流程直接调查当前实现:定位相关文件、隐藏契约、约束、风险和 source anchors。
|
|
70
|
+
5. 启动 repo-local `critic` native subagent(round r1),审查歧义、遗漏场景、矛盾、scope risk 和范围收敛透明度;如存在未显式说明的关键范围收窄,critic 必须 block。critic 输出按上方确认循环要求落成带 `review_round_id` + `findings[]` 的 evidence。
|
|
71
|
+
6. 写入合并后的探索记录文件:
|
|
60
72
|
```text
|
|
61
73
|
openspec/changes/<change>/.superspec/artifacts/discovery.md
|
|
62
74
|
```
|
|
63
75
|
7. 在 `.superspec/evidence/discovery/` 记录 critic evidence,包含 `execution_mode:"native_subagent"`、`agent_role`、`agent_id`、`output_ref`、`source_anchors` 和 `target_refs`。
|
|
64
|
-
8.
|
|
65
|
-
9.
|
|
76
|
+
8. 按确认循环处理 findings:写本轮审查问题记录;存在关键问题时**停下来向用户说明并等待用户确认**,再按用户确认更新探索记录 / 重跑 critic / 写新一轮记录,直到最新轮 clean 且问题清单里没有未处理完的问题。
|
|
77
|
+
9. 运行进入阶段前检查(`check-enter`),验证 explore completion:
|
|
66
78
|
```text
|
|
67
79
|
superspec guard check-enter --change "<change>" --gate explore_complete
|
|
68
80
|
```
|
|
69
81
|
|
|
70
|
-
遇到任何 guard `block`
|
|
82
|
+
遇到任何 guard `block` 就停止。用户确认相关阻塞原因包括:缺少审查问题记录(`missing_review_digest`)、等待用户确认(`needs_user_decision_pending`)、历史 finding 未处理完(`finding_unresolved`)、用户确认未绑定(`user_decision_unbound`)、缺少 finding 问题清单(`ledger_injection_missing`)、审查轮次已达上限(`round_budget_exhausted`)等。它们的唯一合法出路是回到确认循环或升级给用户,不允许绕过。
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: superspec-propose
|
|
3
|
-
description: "2
|
|
3
|
+
description: "2.需求已经清楚后用:把探索记录(`discovery.md`)整理成正式方案包,包括方案说明(`proposal.md`)、需求规格(`specs/**`)、设计说明(`design.md`)、任务清单(`tasks.md`)、测试契约和业务约束;这一步只定方案,不写实现。"
|
|
4
|
+
metadata:
|
|
5
|
+
author: SuperSpec
|
|
6
|
+
source: SuperSpec
|
|
4
7
|
---
|
|
5
8
|
|
|
6
9
|
# SuperSpec Propose
|
|
@@ -10,64 +13,73 @@ description: "2.生成 SuperSpec propose 包,将 artifact 编写委托给 Open
|
|
|
10
13
|
- 默认使用简体中文撰写所有人类可读产物、分析、报告、说明和 OpenSpec 文档正文。
|
|
11
14
|
- 保留命令、路径、JSON 字段、gate 名、task/test id、代码标识符和外部 API 名称的原文。
|
|
12
15
|
- 当 OpenSpec 模板要求固定标题或字段时,保留模板结构,只将正文内容写成中文。
|
|
16
|
+
- 对话窗口里的解释、问题说明、总结、提问和下一步说明必须使用中文;除命令、路径、字段名、代码标识符外,不要夹带英文说明词。
|
|
17
|
+
- 对话窗口、AskUserQuestion 文案、进度更新和最终总结不得裸露内部证据种类、字段名或 reason code;用户确认记录、审查问题记录、审查轮次编号、问题唯一标识等都只用中文业务说法。原始协议名只允许写在证据 JSON、代码、测试、精确命令输出或用户明确要求的诊断片段中。
|
|
18
|
+
- 本 skill 文档中的内部协议名只用于落盘证据或运行 guard;写给用户时必须先翻译成中文业务动作,例如“记录用户确认”“记录审查问题”“完成最终审查判断”。
|
|
19
|
+
- 向用户转述 guard / review 输出时,不要直接贴英文 `message`、`next_allowed_actions` 或英文模板标题;应改写为中文,并仅在需要定位内部协议时保留英文 code/command 于反引号中。
|
|
13
20
|
|
|
14
|
-
|
|
21
|
+
## 命令执行 / Shell
|
|
22
|
+
|
|
23
|
+
- Windows PowerShell 中执行 npm 全局 bin 时,必须显式使用 `.cmd` shim:`superspec.cmd ...`、`openspec.cmd ...`;不要运行 `superspec.ps1` 或 `openspec.ps1`。
|
|
24
|
+
- macOS、Linux、Git Bash、cmd.exe 或其他不会优先拦截 `.ps1` 的 shell 中,继续使用文档中的 `superspec ...`、`openspec ...` 命令。
|
|
25
|
+
|
|
26
|
+
在 explore 完成后使用本 skill,用于把探索记录整理成可执行的正式方案包。OpenSpec 负责生成标准方案文件,具体写法必须通过它自带的指令(`openspec instructions`)获取;SuperSpec 负责在外层增加审查门禁(gates)、业务约束(`business-invariants.md`)、测试契约(`test-contract.md`)和任务元数据。
|
|
15
27
|
|
|
16
28
|
## 边界 / Boundaries
|
|
17
29
|
|
|
18
|
-
-
|
|
19
|
-
- SuperSpec
|
|
20
|
-
- OpenSpec
|
|
21
|
-
- Propose
|
|
22
|
-
-
|
|
23
|
-
- `proposal_reviewed` 是硬性 internal gate(DISC Phase 2),不是 advisory note:`proposal.md` 完成后必须运行带 `review_round_id`(`proposal_reviewed-r<N>`)和 `findings[]` 的 `critic` review
|
|
24
|
-
- `design_complete`、`invariants_reviewed`、`test_contract_drafted` 在出现 round-tagged review evidence
|
|
25
|
-
- `tasks_complete` 仅在新增 round-tagged role review
|
|
26
|
-
- proposal review 的 route 约束:若 finding
|
|
30
|
+
- 先读取项目里的 OpenSpec propose 说明:`.codex/skills/openspec-propose/SKILL.md`。方案文件的生成顺序、`openspec status` 和 `openspec instructions` 的用法以它为准。
|
|
31
|
+
- SuperSpec 不采用“一次性把所有方案文件都生成完”的做法。本阶段不创建或选择 change,也不能绕过 SuperSpec 门禁检查一次性完成所有产物。`superspec-explore` 负责创建 change 和探索记录(`discovery.md`);本 skill 负责按阶段检查来编写正式方案文件。
|
|
32
|
+
- OpenSpec 标准方案文件(`proposal.md`、`specs/**/*.md`、`design.md`、`tasks.md`)**必须**通过 `openspec instructions <artifact> --json` 编写,使用其返回的 `template`/`rules`/`context`。**不要手写这些文件绕过 OpenSpec 自带指令**,否则会丢失标准模板、项目上下文和校验一致性。
|
|
33
|
+
- Propose 阶段还要生成 SuperSpec 补充方案文件:`.superspec/artifacts/business-invariants.md` 和 `.superspec/artifacts/test-contract.md`。任务依赖、读写范围、TDD 元数据和映射关系直接写入 `tasks.md` 的结构化字段,不再维护单独的 JSON 任务图文件。
|
|
34
|
+
- 本阶段门禁检查包括:探索完成 `explore_complete`、方案说明已审查 `proposal_reviewed`(`propose.proposal_reviewed`)、设计已审查 `design_complete`(`propose.design_reviewed`)、业务约束已审查 `invariants_reviewed`(`propose.invariants_reviewed`)、测试契约已起草 `test_contract_drafted`(`propose.test_plan_drafted`)、任务映射已完成 `tasks_complete`(`propose.tasks_mapped`),以及最终 `propose_complete`。
|
|
35
|
+
- `proposal_reviewed` 是硬性 internal gate(DISC Phase 2),不是 advisory note:`proposal.md` 完成后必须运行带 `review_round_id`(`proposal_reviewed-r<N>`)和 `findings[]` 的 `critic` review,并由主流程记录审查问题记录(内部 evidence kind 为 `main_review_digest`)。guard 对该 gate 不提供 legacy 豁免——没有 round-tagged review + digest 一律 block。审查问题确认循环规则(关键 findings 必须经用户确认、findings 问题清单不可抹除、digest 链与轮次连续性)与 `superspec-explore` skill 的「审查问题确认循环 / Review Disclosure Loop」一节完全一致。
|
|
36
|
+
- `design_complete`、`invariants_reviewed`、`test_contract_drafted` 在出现 round-tagged review evidence 后进入同一确认循环(DISC Phase 3);旧式无 `review_round_id`/`findings[]` 的 review evidence 维持 grandfathered 口径(P2-3),但**新写的 review 必须走完整确认循环**。
|
|
37
|
+
- `tasks_complete` 仅在新增 round-tagged role review 后才纳入确认循环(本 gate 本身不强制 role review;一旦 agent 为 tasks 写了带 findings 的 review,就必须完成 digest + 用户确认)。
|
|
38
|
+
- proposal review 的 route 约束:若 finding 证明探索记录本身不完整或范围(`scope`)不清,处理 route 必须是 `return_explore`(回 `superspec-explore` 补事实层),不得在 proposal 内静默补范围;仅措辞/意图不一致且不改范围时才可 `stay_same_gate_fix`。
|
|
27
39
|
- design review 的 route 约束:scope / non-goal 与上游不一致时用 `return_explore_or_proposal_reviewed`;设计边界/架构取舍用 `stay_same_gate_user_decision`。
|
|
28
|
-
- invariants / test-contract review 的 route
|
|
29
|
-
- tasks review 的 route 约束:task 映射 / test_refs / read-write scope 问题用 `stay_same_gate_fix
|
|
40
|
+
- invariants / test-contract review 的 route 约束:业务语义/不变量真相不确定、验收标准(`acceptance`)变更等关键 finding 用 `stay_same_gate_user_decision`;若需回改 spec/design 表达,用 `return_explore_or_proposal_reviewed`。
|
|
41
|
+
- tasks review 的 route 约束:task 映射 / test_refs / read-write scope 问题用 `stay_same_gate_fix`;若验收标准本身错了,用 `return_test_contract_drafted` 回 test-contract gate,不得静默改 tasks 来处理关键 acceptance 问题。
|
|
30
42
|
- Role-gate evidence 必须来自 native subagents。v1 evidence 是 audit-only/self-reported;除非有 OpenSpec facts 支撑,不要把它描述成强制运行时事实。
|
|
31
43
|
|
|
32
44
|
## 步骤 / Steps
|
|
33
45
|
|
|
34
|
-
1.
|
|
46
|
+
1. 运行前置门禁检查(`check-enter`),确认探索阶段已经完成:
|
|
35
47
|
```text
|
|
36
48
|
superspec guard check-enter --change "<change>" --gate explore_complete
|
|
37
49
|
```
|
|
38
|
-
2. 从 OpenSpec
|
|
50
|
+
2. 从 OpenSpec 获取方案文件生成顺序:
|
|
39
51
|
```text
|
|
40
52
|
openspec status --change "<change>" --json
|
|
41
53
|
```
|
|
42
|
-
按 `openspec-propose` 的说明解析 `applyRequires`、`artifacts`(status + dependencies)、`planningHome`、`changeRoot`、`artifactPaths` 和 `actionContext
|
|
43
|
-
3. 对每个状态为 `ready` 的 OpenSpec
|
|
54
|
+
按 `openspec-propose` 的说明解析 `applyRequires`、`artifacts`(status + dependencies)、`planningHome`、`changeRoot`、`artifactPaths` 和 `actionContext`。按依赖顺序编写方案文件(proposal -> specs -> design -> tasks)。
|
|
55
|
+
3. 对每个状态为 `ready` 的 OpenSpec 方案文件,都通过 OpenSpec 自带指令编写:
|
|
44
56
|
```text
|
|
45
57
|
openspec instructions <artifact-id> --change "<change>" --json
|
|
46
58
|
```
|
|
47
|
-
-
|
|
59
|
+
- 读取依赖的方案文件和探索记录 `.superspec/artifacts/discovery.md` 作为上下文。
|
|
48
60
|
- 使用 `template` 写入 `resolvedOutputPath`;把 `context`/`rules` 当约束使用,不要复制进产物正文。
|
|
49
|
-
- 重新运行 `openspec status --change "<change>" --json
|
|
50
|
-
4. `proposal.md` 编写并经 `openspec status` 确认为 `done` 后、开始 `specs/**`/`design.md` 前:执行 `proposal_reviewed`
|
|
51
|
-
- 启动 `critic` native-subagent review
|
|
52
|
-
-
|
|
61
|
+
- 重新运行 `openspec status --change "<change>" --json`,确认该方案文件变为 `done`,再执行对应 SuperSpec 层。
|
|
62
|
+
4. 方案说明 `proposal.md` 编写并经 `openspec status` 确认为 `done` 后、开始 `specs/**`/`design.md` 前:执行 `proposal_reviewed` 确认循环:
|
|
63
|
+
- 启动 `critic` native-subagent review,范围限定在方案范围、意图、非目标和隐藏假设;evidence 必须带 `review_round_id`(`proposal_reviewed-r<N>`)、`findings[]` 和 pinned `target_refs`(`proposal.md` + `.superspec/artifacts/discovery.md`)。
|
|
64
|
+
- 主流程记录审查问题记录,给每个 finding 写处理结果:关键 findings(范围、非目标、验收标准、业务语义、设计边界)必须进入用户确认并停下来,用 AskUserQuestion 把原文和 A/B/C/D 选项展示给用户,拿到用户确认后才能继续;发现探索记录不完整时 route 用 `return_explore` 回 explore,不得自行补范围。
|
|
53
65
|
- 修订 `proposal.md` 后必须重跑 `critic`(新一轮 round),直到 clean round + digest 通过,然后验证:
|
|
54
66
|
```text
|
|
55
67
|
superspec guard check-enter --change "<change>" --gate propose.proposal_reviewed
|
|
56
68
|
```
|
|
57
|
-
guard
|
|
58
|
-
5. `design.md` 编写后:获取 `architect`、`critic`、`test-engineer` 的 native-subagent review evidence(带 `review_round_id` `design_complete-r<N>` + `findings[]` + 全量 pinned target:`proposal.md` + `design.md` + `specs/**/*.md` +
|
|
69
|
+
guard 未通过前不要开始编写 `specs/**` 或 `design.md`(两者的入口门禁都是 `proposal_reviewed`)。
|
|
70
|
+
5. 设计说明 `design.md` 编写后:获取 `architect`、`critic`、`test-engineer` 的 native-subagent review evidence(带 `review_round_id` `design_complete-r<N>` + `findings[]` + 全量 pinned target:`proposal.md` + `design.md` + `specs/**/*.md` + 探索记录)。主流程记录审查问题记录;关键问题必须停下来向用户说明并等待用户确认,按用户确认改 design/specs 后 supersede 旧轮并重审。对于设计选项选择和最终设计确认,使用 AskUserQuestion 并等待明确选择;记录 human-confirmation evidence,然后验证:
|
|
59
71
|
```text
|
|
60
72
|
superspec guard check-enter --change "<change>" --gate propose.design_reviewed
|
|
61
73
|
```
|
|
62
|
-
6. `specs/**`
|
|
74
|
+
6. 需求规格 `specs/**` 和设计说明 `design.md` 编写后、测试契约 `test-contract.md` 编写前:起草业务约束 `.superspec/artifacts/business-invariants.md`。每条 `INV-*` 必须有 statement、scope、source anchors、acceptance_refs、risk_refs、confidence、enforcement_level、test_refs_or_review_only_reason;记录 rejected candidates,防止把当前实现习惯误升格为业务真相。获取 `critic` + `test-engineer` review evidence(带 `review_round_id` `invariants_reviewed-r<N>` + `findings[]` + pinned target:business-invariants + design + specs glob)。主流程记录审查问题记录;关键业务语义问题必须进入用户确认,不得把实现习惯静默升格为 invariant 真相。然后验证:
|
|
63
75
|
```text
|
|
64
76
|
superspec guard check-enter --change "<change>" --gate propose.invariants_reviewed
|
|
65
77
|
```
|
|
66
|
-
7. `business-invariants.md`
|
|
78
|
+
7. 业务约束 `business-invariants.md` 完成后、任务清单 `tasks.md` 编写前:起草测试契约 `.superspec/artifacts/test-contract.md`,覆盖 specs 中每个 `#### Scenario` 和命中本 change scope 的 hard `INV-*`,包含 TEST ids、关联 INV ids、预期 RED reasons、预期 GREEN criteria 和 commands。获取 `test-engineer` + `critic` review evidence(带 `review_round_id` `test_contract_drafted-r<N>` + `findings[]` + pinned target:test-contract + invariants + design + specs glob)。主流程记录审查问题记录;验收标准变更等关键问题必须用户确认。然后验证:
|
|
67
79
|
```text
|
|
68
80
|
superspec guard check-enter --change "<change>" --gate propose.test_plan_drafted
|
|
69
81
|
```
|
|
70
|
-
8. 通过 `openspec instructions tasks`
|
|
82
|
+
8. 通过 `openspec instructions tasks` 编写任务清单 `tasks.md` 时:为每个 task 补充 `requirement_refs`、`invariant_refs`(必须是 business-invariants `INV-*` ids 的子集)、`test_refs`(必须是 test-contract TEST ids 的子集)、`read_scope`、`write_scope`、dependencies、TDD metadata,以及需要时的 parallel group。若 reviewer 对 task 映射提出 round-tagged findings,走 `tasks_complete-r<N>` 确认循环(pinned target:tasks + test-contract + invariants + design + specs glob);验收标准问题 route 用 `return_test_contract_drafted`,映射问题用 `stay_same_gate_fix`。对于任务审查确认,使用 AskUserQuestion 并等待明确选择;记录 human-confirmation evidence,然后验证:
|
|
71
83
|
```text
|
|
72
84
|
superspec guard check-enter --change "<change>" --gate propose.tasks_mapped
|
|
73
85
|
```
|
|
@@ -1,33 +1,45 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: superspec-review
|
|
3
|
-
description: "4
|
|
3
|
+
description: "4.代码任务做完后用:让 reviewer、architect 和 critic 检查实现,跑最终验证,判断能不能进入归档;有问题就退回修。"
|
|
4
|
+
metadata:
|
|
5
|
+
author: SuperSpec
|
|
6
|
+
source: SuperSpec
|
|
4
7
|
---
|
|
5
8
|
|
|
6
9
|
# SuperSpec Review
|
|
7
10
|
|
|
8
|
-
在 implementation tasks 完成后使用本 skill。它完成一个合并后的 review 阶段:实现代码审查 guidance、SuperSpec critic guidance
|
|
11
|
+
在 implementation tasks 完成后使用本 skill。它完成一个合并后的 review 阶段:实现代码审查 guidance、SuperSpec critic guidance、最终验证、主流程最终判断(`main_adjudication`)和 `review_complete` guard 检查。旧 `superspec-verify` / `check-verify-ready` 只是兼容入口,不再作为独立 user-visible workflow。
|
|
9
12
|
|
|
10
13
|
## 语言规则 / Language
|
|
11
14
|
|
|
12
15
|
- 默认使用简体中文撰写所有人类可读产物、分析、报告、说明和 OpenSpec 文档正文。
|
|
13
16
|
- 保留命令、路径、JSON 字段、gate 名、task/test id、代码标识符和外部 API 名称的原文。
|
|
14
17
|
- 当 OpenSpec 模板要求固定标题或字段时,保留模板结构,只将正文内容写成中文。
|
|
18
|
+
- 对话窗口里的解释、审查结论、验证结论、提问和下一步说明必须使用中文;除命令、路径、字段名、代码标识符外,不要夹带英文说明词。
|
|
19
|
+
- 对话窗口、AskUserQuestion 文案、进度更新和最终总结不得裸露内部证据种类、字段名或 reason code;用户确认记录、审查问题记录、审查轮次编号、问题唯一标识等都只用中文业务说法。原始协议名只允许写在证据 JSON、代码、测试、精确命令输出或用户明确要求的诊断片段中。
|
|
20
|
+
- 本 skill 文档中的内部协议名只用于落盘证据或运行 guard;写给用户时必须先翻译成中文业务动作,例如“记录用户确认”“记录审查问题”“完成最终审查判断”。
|
|
21
|
+
- 向用户转述 guard / review / verification 输出时,不要直接贴英文 `message`、`next_allowed_actions`、`Summary`、`Justification`、`PASS/FAIL` 等模板词;应改写为中文,并仅在需要定位内部协议时保留英文 code/command 于反引号中。
|
|
22
|
+
|
|
23
|
+
## 命令执行 / Shell
|
|
24
|
+
|
|
25
|
+
- Windows PowerShell 中执行 npm 全局 bin 时,必须显式使用 `.cmd` shim:`superspec.cmd ...`、`openspec.cmd ...`;不要运行 `superspec.ps1` 或 `openspec.ps1`。
|
|
26
|
+
- macOS、Linux、Git Bash、cmd.exe 或其他不会优先拦截 `.ps1` 的 shell 中,继续使用文档中的 `superspec ...`、`openspec ...` 命令。
|
|
15
27
|
|
|
16
28
|
## 硬边界
|
|
17
29
|
|
|
18
30
|
- `review_complete` 是 allow-only gate。只有 `main_adjudication.review_decision:"allow"` 才允许进入 `check-review-complete` / `archive_ready`。
|
|
19
31
|
- allow path 的 `review_complete` 必须包含 `kind:"source_guidance"`(`code-reviewer`、`architect`、`critic`)、`kind:"verification_review"`(`verifier`、`critic`)、`kind:"final_test"` 和非角色 `kind:"main_adjudication"`;其中 `openspec validate` 输出必须被 `verification_review.openspec_validate_ref` 引用。`request_changes` 分支不应伪装成 `review_complete`。
|
|
20
|
-
- `superspec-review` 直接拥有并执行 repo-local review 协议:本阶段必须先启动 `code-reviewer`、`architect`、`critic` native subagent 产出 `source_guidance`;若走 allow path,再完成 final verification
|
|
32
|
+
- `superspec-review` 直接拥有并执行 repo-local review 协议:本阶段必须先启动 `code-reviewer`、`architect`、`critic` native subagent 产出 `source_guidance`;若走 allow path,再完成 final verification;随后由主流程读取关键 source 与必要的 verification evidence,写出唯一 `main_adjudication`。
|
|
21
33
|
- 不要把 code review 外包给全局/独立 `code-review` skill、OMX runtime workflow 或普通 markdown 报告;不需要单独安装 `code-review` skill。全局 `code-review` skill 只能作为机制参考,gate 只认 repo-local SuperSpec role surfaces 和 `.superspec` evidence schema。
|
|
22
34
|
- 所有 review / critic / verifier role evidence 都必须来自 repo-local native subagents。不要用 main-thread self-review、同名 global prompt、普通 markdown 报告或 `execution_mode:"direct"` 替代。
|
|
23
|
-
- review-phase native subagent 只能给 guidance
|
|
24
|
-
- `main_adjudication` 的作者边界固定为 `execution_mode:"direct"` + `created_by:"main-thread"`;它不得携带 `agent_role`、`agent_id`、`prompt_ref
|
|
25
|
-
- review 没有直接回改 `tasks.md` 的权限。若 review 认定“原已完成 task
|
|
35
|
+
- review-phase native subagent 只能给 guidance,不能替代主流程最终判断。主流程必须在读取关键 source 与 verification evidence 之后,通过 `main_adjudication` 显式记录:看了哪些关键 source、采纳或驳回了哪些 claim、最终为什么 allow/block。
|
|
36
|
+
- `main_adjudication` 的作者边界固定为 `execution_mode:"direct"` + `created_by:"main-thread"`;它不得携带 `agent_role`、`agent_id`、`prompt_ref`。不要留“像主流程”的自由格式。
|
|
37
|
+
- review 没有直接回改 `tasks.md` 的权限。若 review 认定“原已完成 task 的完成证明失效”,主流程只能写出结构化 `request_changes` 判断,为 apply 提供 reopen 授权;不要在 review 阶段直接把 task 从 `[x]` 改回 `[ ]`。
|
|
26
38
|
- `review_decision:"request_changes"` 必须显式声明路由:`request_changes_route:"reopen_tasks"` 表示回 apply 返工既有 task;`request_changes_route:"change_update"` 表示回 propose / change update。不要把需求/范围/设计问题伪装成 task reopen。
|
|
27
39
|
- `review_decision:"request_changes"` 时,`verification_evidence_refs` 必须为空;不要在 request-changes round 里补写 allow-path verification 再尝试过 `review_complete`。
|
|
28
|
-
-
|
|
29
|
-
- `task_reopen`、配套 `status:"superseded"` evidence 和 `task_reopen_resolved` 不由 review 写入;它们的作者边界固定在 `superspec-apply`
|
|
30
|
-
-
|
|
40
|
+
- 路由判断遵循单值优先级:只要同一轮 review 中仍存在任何必须回 propose / change update 的 blocker,`request_changes_route` 就必须取 `change_update`;只有当所有未解决 blocker 都可由既有 task 返工处理完时,才允许取 `reopen_tasks`。
|
|
41
|
+
- `task_reopen`、配套 `status:"superseded"` evidence 和 `task_reopen_resolved` 不由 review 写入;它们的作者边界固定在 `superspec-apply` 主流程。
|
|
42
|
+
- 阻塞 findings 必须有 dispositions 和 rollback targets。遇到任何 guard `block` 就停止。
|
|
31
43
|
- 如果 verification fails,且需要在修复与接受偏差之间做选择,使用 structured user input / AskUserQuestion;不要使用默认值、历史偏好或沉默作为确认。
|
|
32
44
|
|
|
33
45
|
## 仓库本地角色入口
|
|
@@ -48,26 +60,26 @@ Required project-scope files: `.codex/agents/code-reviewer.toml`、`.codex/promp
|
|
|
48
60
|
```
|
|
49
61
|
2. 从 `git diff`、OpenSpec artifacts、tasks、business invariants、test contract、red/green evidence 和 `.superspec` evidence 构建审查范围。
|
|
50
62
|
3. 运行 repo-local review guidance:
|
|
51
|
-
- 启动 repo-local `code-reviewer` native subagent
|
|
52
|
-
- 启动 repo-local `architect` native subagent
|
|
53
|
-
- 启动独立 repo-local `critic` native subagent,审查 superspec-specific scope drift、隐藏假设、业务不变量是否被测试/实现扭曲、遗漏的 rollback targets 和 evidence
|
|
54
|
-
4.
|
|
63
|
+
- 启动 repo-local `code-reviewer` native subagent,记录审查指导证据(内部 JSON kind 为 `source_guidance`)。
|
|
64
|
+
- 启动 repo-local `architect` native subagent,记录审查指导证据(内部 JSON kind 为 `source_guidance`)。
|
|
65
|
+
- 启动独立 repo-local `critic` native subagent,审查 superspec-specific scope drift、隐藏假设、业务不变量是否被测试/实现扭曲、遗漏的 rollback targets 和 evidence 充分性,并记录审查指导证据(内部 JSON kind 为 `source_guidance`)。
|
|
66
|
+
4. 主流程读取关键 source,准备 `main_adjudication` 输入:
|
|
55
67
|
- 从每条 `source_guidance.source_refs` 中判断哪些内容需要亲自加载。
|
|
56
68
|
- `source_refs` / `required_load_refs` 使用 `pinned_ref = {path, blob_sha}`;其中 `pinned_ref.path` 一律是 repo-root relative path。`required_load_refs` 必须按 `(path, blob_sha)` 精确包含于 `source_refs`。
|
|
57
69
|
- 对所有 `required_load_refs` 做真实读取,并在 `loaded_refs` 中记录同样的 `pinned_ref`;`loaded_refs` 必须按 `(path, blob_sha)` 精确覆盖全部 `required_load_refs`,同一路径不同 blob 不算已加载。
|
|
58
70
|
- 对所有 `required_claim_ids` 写出结构化 `claim_adjudications[] = {claim_id, decision, rationale}`。
|
|
59
71
|
- 对所有 `blocking_findings[*].finding_id` 写出结构化 `finding_adjudications[] = {finding_id, decision, rationale}`。
|
|
60
|
-
- `claim_adjudications[].decision` 使用 `accept | reject | needs_fix`;`needs_fix` 不是 allow
|
|
61
|
-
- `finding_adjudications[].decision` 使用 `dismissed | accepted_fixed | accepted_deviation | needs_fix`;只有前三者是 allow
|
|
72
|
+
- `claim_adjudications[].decision` 使用 `accept | reject | needs_fix`;`needs_fix` 不是 allow 最终状态。
|
|
73
|
+
- `finding_adjudications[].decision` 使用 `dismissed | accepted_fixed | accepted_deviation | needs_fix`;只有前三者是 allow 最终状态。
|
|
62
74
|
5. 先判断本轮是否进入 `reopen_authorization` 分支:
|
|
63
75
|
- 当 blocking finding 已具备 `completion_invalidity_class`,且 `scope_expansion:false`,并且问题指向“既有 task 的完成证明失效”时,本轮 review 进入 `reopen_authorization`。
|
|
64
76
|
- 若同一轮 review 仍存在任何 scope / requirement / design / artifact blocker 需要回 propose 或 change update,则不得进入 `reopen_authorization`;此时 `request_changes_route` 必须改为 `change_update`。
|
|
65
77
|
- 在 `reopen_authorization` 分支中:
|
|
66
|
-
- 供 v1 guard / apply 消费的最小 reopen
|
|
67
|
-
-
|
|
78
|
+
- 供 v1 guard / apply 消费的最小 reopen 映射只有一条:被主流程选入 `blocking_source_evidence_refs` 的 `code-reviewer source_guidance`,其 `blocking_findings[*].affected_task_ids` 必须覆盖待 reopen 的 task。
|
|
79
|
+
- 主流程稍后写出的 `main_adjudication` 必须包含 `review_decision:"request_changes"`、`request_changes_route:"reopen_tasks"`、`blocking_source_evidence_refs`、`reopen_task_ids`
|
|
68
80
|
- 不调用 `check-review-complete`
|
|
69
81
|
- 不生成面向 allow 的 `verification_review` / `final_test` evidence
|
|
70
|
-
6. 仅在 allow
|
|
82
|
+
6. 仅在 allow 评估路径执行 final verification:
|
|
71
83
|
```text
|
|
72
84
|
openspec validate "<change>"
|
|
73
85
|
```
|
|
@@ -75,10 +87,10 @@ Required project-scope files: `.codex/agents/code-reviewer.toml`、`.codex/promp
|
|
|
75
87
|
- 生成 task matrix、invariant matrix 和 scope drift assessment。
|
|
76
88
|
- 启动 repo-local `verifier` native subagent,复核 completion evidence、测试充分性、OpenSpec validation 和 task matrix,并记录 `kind:"verification_review"`。
|
|
77
89
|
- 启动 repo-local `critic` native subagent,复核 scope drift、accepted deviations 和 evidence 充分性,并记录 `kind:"verification_review"`。
|
|
78
|
-
- `verification_review` 只提供 proof/gap
|
|
79
|
-
7.
|
|
90
|
+
- `verification_review` 只提供 proof/gap,不替代主流程最终判断;若发现新的 blocking issue,则本轮 review 保持 block,修复后重跑 verification,再进入最终判断。
|
|
91
|
+
7. 主流程写入唯一一条最终审查判断证据(内部 JSON kind 为 `main_adjudication`):
|
|
80
92
|
- allow path 必须同时引用 `source_guidance` 和 `verification_review` / `final_test` evidence。
|
|
81
|
-
- 若任何 verification gap
|
|
93
|
+
- 若任何 verification gap 仍未处理完,不得写出 allow 所需的最终判断记录。
|
|
82
94
|
- 若结论是 `review_decision:"request_changes"`,必须同时写清 `request_changes_route`:
|
|
83
95
|
- `reopen_tasks`:显式列出 `reopen_task_ids`,把问题退回 apply 修复既有 task。
|
|
84
96
|
- `change_update`:显式说明需要回 propose / change update;此时 `reopen_task_ids` 必须为空。
|
|
@@ -87,24 +99,24 @@ Required project-scope files: `.codex/agents/code-reviewer.toml`、`.codex/promp
|
|
|
87
99
|
```text
|
|
88
100
|
superspec guard check-review-complete --change "<change>"
|
|
89
101
|
```
|
|
90
|
-
-
|
|
102
|
+
- 只有最终 allow path 才应执行并通过这一步。
|
|
91
103
|
- 如果本轮 `main_adjudication.review_decision:"request_changes"`,则本轮 review 的正确出口是停止并回到对应路由;不要把 `request_changes` 轮次伪装成 `review_complete`。
|
|
92
104
|
|
|
93
105
|
## Review Guidance 协议
|
|
94
106
|
|
|
95
|
-
`superspec-review` 直接拥有 review guidance 协议。本阶段必须启动 repo-local `code-reviewer`、`architect`、`critic` native subagents,记录结构化 `source_guidance` evidence;allow path 还要补齐 final verification
|
|
107
|
+
`superspec-review` 直接拥有 review guidance 协议。本阶段必须启动 repo-local `code-reviewer`、`architect`、`critic` native subagents,记录结构化 `source_guidance` evidence;allow path 还要补齐 final verification,然后由主流程写出唯一一条 `main_adjudication`。
|
|
96
108
|
|
|
97
109
|
不要为 code review 调用另一个 skill 或 workflow。不要用 `$code-review`、global skills、OMX runtime workflows、main-thread self-review 或普通 markdown 报告替代这些 guidance lanes。
|
|
98
110
|
|
|
99
111
|
## Review 到 Apply 的回退协议
|
|
100
112
|
|
|
101
|
-
- 当 review 发现的是“既有 task
|
|
113
|
+
- 当 review 发现的是“既有 task 的验收条件没有真正满足”,主流程必须把这类问题写成可机判的 `request_changes` 判断,而不是留在自由文本里等待人工理解。
|
|
102
114
|
- `request_changes_route:"reopen_tasks"` 是唯一允许进入 `task_reopen -> apply_fix` 的 review 路由;对应 `reopen_task_ids` 必须明确列出受影响 task。
|
|
103
115
|
- `request_changes_route:"change_update"` 表示问题属于需求、范围、设计或 artifact 边界,正确出口是回 propose / change update,而不是 reopen 现有 task。
|
|
104
|
-
- 若同一轮 review 同时存在 reopen-compatible blocker 与 change-update blocker,必须按 `change_update`
|
|
105
|
-
- 返工完成后的新一轮 review,必须 supersede 旧的 `request_changes` `main_adjudication` 以及它依赖的相关 source evidence
|
|
116
|
+
- 若同一轮 review 同时存在 reopen-compatible blocker 与 change-update blocker,必须按 `change_update` 判断;不要把混合 blocker 压缩成 reopen。
|
|
117
|
+
- 返工完成后的新一轮 review,必须 supersede 旧的 `request_changes` `main_adjudication` 以及它依赖的相关 source evidence,避免旧阻塞判断继续留在 live/pass 集合中。
|
|
106
118
|
- 对仍停留在 legacy `.irsflow/*` review evidence 的 change,进入 reopen 协议前应先执行一次 review-only backfill:在 `.superspec/evidence/reviews/` 下重跑结构化 `source_guidance` 与 `main_adjudication`,但不要把旧 `.irsflow` evidence 直接并入 live 集合。
|
|
107
|
-
- review 不负责创建 `task_reopen` / `status:"superseded"` / `task_reopen_resolved`;这些 lifecycle evidence 由 apply
|
|
119
|
+
- review 不负责创建 `task_reopen` / `status:"superseded"` / `task_reopen_resolved`;这些 lifecycle evidence 由 apply 主流程接管。
|
|
108
120
|
|
|
109
121
|
### 必需 native subagent guidance
|
|
110
122
|
|
|
@@ -123,9 +135,9 @@ Required project-scope files: `.codex/agents/code-reviewer.toml`、`.codex/promp
|
|
|
123
135
|
- 反方论证:反对原样 approve 的最强理由。
|
|
124
136
|
`critic` guidance 负责反方论证:
|
|
125
137
|
|
|
126
|
-
-
|
|
127
|
-
- 标记哪些 source
|
|
128
|
-
- 把“subagent
|
|
138
|
+
- 质疑主流程可能忽略的边界、范围漂移、证据跳读和 accepted deviation。
|
|
139
|
+
- 标记哪些 source 必须由主流程亲自加载,而不是只看 summary。
|
|
140
|
+
- 把“subagent 只提供审查建议,不做最终判断”落实成可机检的 claims / loads。
|
|
129
141
|
|
|
130
142
|
### 严重级别
|
|
131
143
|
|
|
@@ -137,10 +149,10 @@ Required project-scope files: `.codex/agents/code-reviewer.toml`、`.codex/promp
|
|
|
137
149
|
### 综合规则
|
|
138
150
|
|
|
139
151
|
- subagent 可以报告风险、缺口、建议和推荐动作,但不能直接决定 `review_complete` allow。
|
|
140
|
-
- `review_complete`
|
|
141
|
-
- `required_load_refs`
|
|
142
|
-
- `required_claim_ids`
|
|
143
|
-
- 每个 `blocking_findings[*].finding_id`
|
|
152
|
+
- `review_complete` 只接受主流程 `main_adjudication` 作为最终判断 proof;没有它即使所有 subagent 都写了 “pass” 也必须 block。
|
|
153
|
+
- `required_load_refs` 必须被主流程真实读取并记录到 `loaded_refs`,并且按 `(path, blob_sha)` 精确匹配,否则 block。
|
|
154
|
+
- `required_claim_ids` 必须被主流程显式处理,否则 block。
|
|
155
|
+
- 每个 `blocking_findings[*].finding_id` 都必须被主流程显式处理;有 blocker 没有 `finding_adjudications[]`、或 decision 仍是 `needs_fix` 时,直接 block。
|
|
144
156
|
|
|
145
157
|
## 证据契约
|
|
146
158
|
|
|
@@ -166,9 +178,9 @@ Required project-scope files: `.codex/agents/code-reviewer.toml`、`.codex/promp
|
|
|
166
178
|
- `output_ref`
|
|
167
179
|
- `source_anchors`
|
|
168
180
|
- `target_refs`:非空 `{path, blob_sha}` 列表,指向被审查目标,并且在 evidence 创建时保持 fresh;对于 review-phase `source_guidance`,其中 `path` 一律是 repo-root relative path
|
|
169
|
-
- `source_refs
|
|
170
|
-
- `required_load_refs
|
|
171
|
-
- `required_claim_ids
|
|
181
|
+
- `source_refs`:主流程可进一步读取的原始 source/artifact/log refs,使用 `pinned_ref = {path, blob_sha}`,其中 `path` 一律是 repo-root relative path
|
|
182
|
+
- `required_load_refs`:主流程必须亲自读取的关键 refs,使用 `pinned_ref = {path, blob_sha}`,并且必须是 `source_refs` 的精确子集
|
|
183
|
+
- `required_claim_ids`:主流程必须在 `main_adjudication` 中显式处理的 claim ids
|
|
172
184
|
- `base_ref`
|
|
173
185
|
- `head_ref`
|
|
174
186
|
- `reviewed_files`:repo-root relative path 列表
|
|
@@ -183,7 +195,7 @@ Required project-scope files: `.codex/agents/code-reviewer.toml`、`.codex/promp
|
|
|
183
195
|
|
|
184
196
|
`violated_test_ids` / `violated_requirement_refs` / `why_completion_invalid` / `required_fix` 等更重的 reopen lifecycle 字段可以作为详细 overlay 保留在专门设计文档中,但不属于 v1 canonical guard 必填项。
|
|
185
197
|
|
|
186
|
-
|
|
198
|
+
主流程 `kind:"main_adjudication"` evidence 必须包含:
|
|
187
199
|
|
|
188
200
|
- `gate:"review_complete"`
|
|
189
201
|
- `kind:"main_adjudication"`
|
|
@@ -225,13 +237,13 @@ Required project-scope files: `.codex/agents/code-reviewer.toml`、`.codex/promp
|
|
|
225
237
|
- `test_command`
|
|
226
238
|
- `output_ref`
|
|
227
239
|
|
|
228
|
-
并依赖 canonical evidence `status:"pass"` 作为 allow 所需的成功状态;`output_ref`
|
|
240
|
+
并依赖 canonical evidence `status:"pass"` 作为 allow 所需的成功状态;`output_ref` 必须指向本次最终测试运行的可读日志/结果。
|
|
229
241
|
|
|
230
242
|
在 `review_complete` 判定中,只接受 `gate:"review_complete"` 的 `verification_review` / `final_test` 证据。`check-verify-ready` / `verify_complete` 只是兼容命令别名,不得单独扩大证据来源。
|
|
231
243
|
|
|
232
244
|
## 停止条件
|
|
233
245
|
|
|
234
246
|
- 任一 guard command 返回 `block` 时立即停止。
|
|
235
|
-
- 任何 `required_load_refs`
|
|
247
|
+
- 任何 `required_load_refs` 未被主流程读取、任何 `required_claim_ids` 未被主流程处理、任何 `blocking_findings[*].finding_id` 未被 `finding_adjudications[]` 恰好处理一次、其 decision 仍为 `needs_fix` 时,必须停止并补证据;若当前走 allow path,任何 final verification proof 缺失同样必须停止并补证据。
|
|
236
248
|
- 如果本轮 `main_adjudication.review_decision:"request_changes"`,停止在 route 明确后的 handoff 上:`reopen_tasks` 回 apply,`change_update` 回 propose / change update。
|
|
237
249
|
- 只有 `check-review-complete` 返回 `allow` 后才算完成。
|