@peterxiaoyang/superspec 0.1.11 → 0.1.12
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 +4 -4
- package/dist/src/apply_worker_chain.d.ts +6 -3
- package/dist/src/apply_worker_chain.js +125 -30
- package/dist/src/apply_worker_chain_lifecycle.d.ts +7 -5
- package/dist/src/apply_worker_chain_lifecycle.js +153 -22
- package/dist/src/cli_args.d.ts +1 -0
- package/dist/src/cli_args.js +33 -15
- package/dist/src/disclosure.js +2 -2
- package/dist/src/evidence.js +104 -8
- package/dist/src/gates.d.ts +1 -0
- package/dist/src/gates.js +160 -27
- package/dist/src/hooks/guard_api.js +2 -2
- package/dist/src/hooks/policy_event.js +11 -1
- package/dist/src/i18n.js +63 -3
- package/dist/src/init_cli.js +1 -1
- package/dist/src/openspec.d.ts +2 -0
- package/dist/src/openspec.js +31 -0
- package/dist/src/packet_render.d.ts +1 -0
- package/dist/src/packet_render.js +248 -31
- package/dist/src/packet_schema.d.ts +2 -0
- package/dist/src/tasks.d.ts +5 -0
- package/dist/src/tasks.js +62 -0
- package/dist/src/util.d.ts +4 -0
- package/dist/src/util.js +13 -0
- package/dist/superspec.js +4 -4
- package/package.json +3 -3
- package/templates/sidecar/discovery.md +9 -0
- package/templates/sidecar/test-contract.md +2 -1
- package/templates/workflow/prompts/code-reviewer.md +1 -1
- package/templates/workflow/prompts/executor.md +1 -1
- package/templates/workflow/prompts/test-engineer.md +1 -0
- package/templates/workflow/prompts/test-runner.md +3 -1
- package/templates/workflow/prompts/verifier.md +9 -9
- package/templates/workflow/skills/superspec-apply/SKILL.md +58 -33
- package/templates/workflow/skills/superspec-archive/SKILL.md +5 -5
- package/templates/workflow/skills/superspec-explore/SKILL.md +18 -12
- package/templates/workflow/skills/superspec-propose/SKILL.md +26 -15
- package/templates/workflow/skills/superspec-review/SKILL.md +17 -17
- package/dist/src/packet_measure.d.ts +0 -43
- package/dist/src/packet_measure.js +0 -382
- /package/bin/{superspec-guard.js → superspec-check.js} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@peterxiaoyang/superspec",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.12",
|
|
4
4
|
"description": "SuperSpec workflow package: guard runtime, generic workflow templates, and Codex adapter payload.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
},
|
|
21
21
|
"bin": {
|
|
22
22
|
"superspec": "bin/superspec.js",
|
|
23
|
-
"superspec-
|
|
23
|
+
"superspec-check": "bin/superspec-check.js",
|
|
24
24
|
"superspec-hook": "bin/superspec-hook.js",
|
|
25
25
|
"superspec-init": "bin/superspec-init.js"
|
|
26
26
|
},
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"scripts": {
|
|
57
57
|
"build": "node build.js",
|
|
58
58
|
"typecheck": "tsc --noEmit",
|
|
59
|
-
"test": "node --test tests/test_install_engine.test.ts tests/
|
|
59
|
+
"test": "node --test tests/test_install_engine.test.ts tests/test_real_openspec_smoke.test.ts tests/test_superspec_cli.test.ts tests/test_superspec_guard_output.test.ts tests/test_superspec_guard_core.test.ts tests/test_superspec_guard_review.test.ts tests/test_superspec_guard_request_reopen.test.ts tests/test_superspec_guard_archive.test.ts tests/test_superspec_guard_packet.test.ts tests/test_superspec_guard_disclosure.test.ts tests/test_superspec_hooks.test.ts tests/test_superspec_i18n.test.ts tests/test_superspec_skills.test.ts",
|
|
60
60
|
"prepack": "npm run build",
|
|
61
61
|
"prepublishOnly": "npm run build",
|
|
62
62
|
"pack:dry-run": "npm pack --dry-run"
|
|
@@ -18,6 +18,15 @@
|
|
|
18
18
|
|
|
19
19
|
-
|
|
20
20
|
|
|
21
|
+
## 待确认问题
|
|
22
|
+
|
|
23
|
+
<!-- 需要用户拍板的问题逐条列在此处:未决用 "- [ ]",已确认用 "- [x]"。
|
|
24
|
+
explore_complete 检查在所有项变成 "- [x]"(或标注「已确认」)之前不会通过,也不会进入 propose。
|
|
25
|
+
段标题包含「确认」字样即可被识别(待确认 / 需要用户确认 等)。 -->
|
|
26
|
+
|
|
27
|
+
- [ ] <待确认问题 1>
|
|
28
|
+
- [ ] <待确认问题 2>
|
|
29
|
+
|
|
21
30
|
## Subagent Evidence
|
|
22
31
|
|
|
23
32
|
- explore:
|
|
@@ -13,12 +13,13 @@
|
|
|
13
13
|
- `invariant_refs`: INV-xxx
|
|
14
14
|
- `expected_red`: <实现前因何失败>
|
|
15
15
|
- `expected_green`: <实现后通过的判据>
|
|
16
|
-
- `test_command`:
|
|
16
|
+
- `test_command`: <framework-agnostic command that runs exactly the target test identity>
|
|
17
17
|
|
|
18
18
|
## Iron Law
|
|
19
19
|
|
|
20
20
|
- 没有正在失败的测试,不准写实现代码。
|
|
21
21
|
- 每个实现型 task:先有 RED evidence 才能改实现代码,先有 GREEN evidence 才能勾选。
|
|
22
|
+
- 测试证据语义(框架无关):`target test identity executed` 才算有效运行;`command exit code alone is not proof`,退出码 0 不等于目标测试跑过/通过;命令在到达测试 runner 之前失败属于 `blocked before the target test runner`,不是 RED/GREEN;`do not classify environment/build failures as RED or GREEN`。
|
|
22
23
|
|
|
23
24
|
## 与 tasks 的映射约定
|
|
24
25
|
|
|
@@ -22,7 +22,7 @@ argument-hint: "任务说明、review-packet 或 apply-code-review-packet prompt
|
|
|
22
22
|
|
|
23
23
|
在 apply worker path 中,先读取 `apply-code-review-packet`。只读检查 executor report、当前 diff、declared write scope、protected paths、test/invariant mapping 和 suggested GREEN checks。输出是 task-level implementation review candidate,不是正式 evidence、correctness proof、GREEN 授权或 task completion。
|
|
24
24
|
|
|
25
|
-
apply worker
|
|
25
|
+
apply worker report 字段以提示包的 `code_review_report_required_fields` 为准;不要凭本 prompt 记忆或发明字段名。
|
|
26
26
|
|
|
27
27
|
遵守 `common_worker_report_policy`:长日志、完整 diff、编译输出和大段生成内容必须作为 artifact refs 返回,不要内联或截断。
|
|
28
28
|
|
|
@@ -27,6 +27,6 @@ argument-hint: "任务说明或 apply-executor-packet prompt_ref"
|
|
|
27
27
|
- 所有用户可见输出必须使用简体中文。
|
|
28
28
|
- 命令、路径、JSON/schema 字段、gate 名称、task/test id、代码标识符保留原文。
|
|
29
29
|
- 结论先行:完成、阻塞或部分完成。
|
|
30
|
-
-
|
|
30
|
+
- 报告字段以提示包的 `executor_report_required_fields` 为准;不要凭本 prompt 记忆或发明字段名。
|
|
31
31
|
- 报告还必须包含 `role:"executor"`、`origin_packet_fingerprint`、`input_ref_digest`、`source_implementation_fingerprint`、`produced_implementation_fingerprint`;这些字段必须来自 packet / runtime,不要自行发明。
|
|
32
32
|
- 遵守 `common_worker_report_policy`:长日志、完整 diff、编译输出和大段生成内容必须作为 artifact refs 返回,不要内联或截断。
|
|
@@ -13,6 +13,7 @@ argument-hint: "任务说明或 review-packet prompt_ref"
|
|
|
13
13
|
|
|
14
14
|
- SuperSpec review/propose lane 默认只读;不要修改方案、测试契约或实现。
|
|
15
15
|
- 普通测试实现任务中,只写测试,不写业务实现;需要实现改动时向主流程说明。
|
|
16
|
+
- Apply 阶段如需新增或修改 RED/characterization 测试文件,只在主流程明确交付的 bounded native lane 内写测试;正式 RED/characterization/GREEN 运行证据仍由 test-runner packet 生成。
|
|
16
17
|
- 必须核对现有测试模式和目标 acceptance,不用臆测替代证据。
|
|
17
18
|
|
|
18
19
|
## SuperSpec Packet 规则
|
|
@@ -13,6 +13,7 @@ argument-hint: "任务说明或 apply-test-packet prompt_ref"
|
|
|
13
13
|
|
|
14
14
|
- 默认只读;不要修改 production code、OpenSpec artifacts、`.superspec/**`、task checkbox、review artifacts 或 archive artifacts。
|
|
15
15
|
- 只能执行 `apply-test-packet` 中的 `allowed_test_command`,不要发明、改写或补充命令。
|
|
16
|
+
- 只有 test-runner worker 运行结果可以成为正式 RED/characterization/GREEN candidate;不要让主线程代跑或伪造正式 evidence。
|
|
16
17
|
- 如果 packet 没有 `allowed_test_command`、`worker_state` 不是 `ready`、命令上下文不足或测试产生未声明副作用,停止并报告 blocker。
|
|
17
18
|
- fixture/snapshot 更新只有在 packet 明确列入 `expected_worktree_side_effects` 时才可接受;否则视为不可接收风险。
|
|
18
19
|
|
|
@@ -27,7 +28,8 @@ argument-hint: "任务说明或 apply-test-packet prompt_ref"
|
|
|
27
28
|
- 所有用户可见输出必须使用简体中文。
|
|
28
29
|
- 命令、路径、JSON/schema 字段、gate 名称、task/test id、代码标识符保留原文。
|
|
29
30
|
- 结论先行:测试阶段完成、阻塞或不可接收。
|
|
30
|
-
-
|
|
31
|
+
- 报告字段以提示包的 `test_runner_report_required_fields` 为准;不要凭本 prompt 记忆或发明字段名。
|
|
31
32
|
- 报告还必须包含 `role:"test-runner"`、`origin_packet_fingerprint`、`input_ref_digest`、`source_implementation_fingerprint`、`observed_implementation_fingerprint`;这些字段必须来自 packet / runtime,不要自行发明。
|
|
32
33
|
- RED packet 带 `expected_failure_signature` 或 `expected_failure_classifier` 时,报告和 raw transcript 必须证明匹配;无关 import/build/env/timeout 失败不能作为有效 RED。
|
|
34
|
+
- 测试证据语义(框架无关):只有 `target test identity executed` 才算有效运行;`command exit code alone is not proof`,退出码 0 不证明目标测试真正跑过/通过;命令在到达测试 runner 之前就失败属于 `blocked before the target test runner`,必须作为 blocker 报告;`do not classify environment/build failures as RED or GREEN`。
|
|
33
35
|
- 遵守 `common_worker_report_policy`:长日志、完整 diff、编译输出和大段生成内容必须作为 artifact refs 返回,不要内联或截断。
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: "
|
|
3
|
-
argument-hint: "
|
|
2
|
+
description: "完成验证角色"
|
|
3
|
+
argument-hint: "review-packet 或 apply-verify-packet prompt_ref"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Verifier
|
|
7
7
|
|
|
8
8
|
## 角色身份
|
|
9
9
|
|
|
10
|
-
你是 Verifier
|
|
10
|
+
你是 Verifier。将完成声明转成可复现证据,或指出证明缺口。缺证据不是通过;提供 verification guidance,不替代主流程最终判断。
|
|
11
11
|
|
|
12
12
|
## 读写边界
|
|
13
13
|
|
|
14
14
|
- 默认只读;不要修改文件。
|
|
15
|
-
-
|
|
15
|
+
- 核对命令输出、测试结果、diff、artifact、evidence refs 和验收标准。
|
|
16
16
|
- 区分行为失败、证明缺失、命令不可用和范围不清。
|
|
17
17
|
|
|
18
18
|
## SuperSpec Packet 规则
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
`superspec-review` verification lane 先读 `review-packet` 或 `prompt_ref`;以 packet refs/scope、`required_output_kind`、`output_contract_fields` 和 stop conditions 为准;不要依赖本 prompt 记忆输出 schema。
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
确认 `required_output_kind` 是 `verification_review` 后再输出 verification review。
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
apply worker path 先读 `apply-verify-packet`。只读核对 executor/code-review refs、worktree、scope/protected paths 和 freshness。`completion_proof_kind:"green_tests"` 核对 RED/characterization 与 GREEN;`completion_proof_kind:"alternative_verification"` 核对 `pre_edit_proof_kind:"no_tdd_declared"`、空 pre-edit refs、`tdd_required:false`、surface/no-TDD metadata、`alternative_verification_evidence_refs` / manual refs。输出只是 candidate,不替代 `task_complete.allowed`。
|
|
25
25
|
|
|
26
|
-
apply worker report
|
|
26
|
+
apply worker report 字段以提示包的 `verifier_report_required_fields` 为准;不要凭本 prompt 记忆或发明字段名。alternative 分支的 `input_ref_digest` 必须覆盖 executor report、code-review report、`alternative_verification_evidence_refs` 和 active chain no-TDD metadata。
|
|
27
27
|
|
|
28
|
-
遵守 `common_worker_report_policy`:长日志、完整 diff、编译输出和大段生成内容用 artifact refs
|
|
28
|
+
遵守 `common_worker_report_policy`:长日志、完整 diff、编译输出和大段生成内容用 artifact refs,不内联。
|
|
29
29
|
|
|
30
30
|
## 输出风格
|
|
31
31
|
|
|
@@ -10,7 +10,7 @@ metadata:
|
|
|
10
10
|
|
|
11
11
|
## 语言规则 / Language
|
|
12
12
|
|
|
13
|
-
-
|
|
13
|
+
- 默认使用简体中文写人类可读内容;命令、路径、字段名、阶段门名、task/test id、代码标识符保留原文。
|
|
14
14
|
- 用户可见文案不得使用“裁决”描述用户动作;统一说“确认”“范围取舍”“处理方式选择”或“用户确认记录”。
|
|
15
15
|
- 不把内部证据种类、reason code、JSON 字段大全直接转述给用户;需要诊断时才引用原文。
|
|
16
16
|
- 普通 workflow 命令使用 `--format agent`;`--format json` 只用于诊断,不作为默认上下文。
|
|
@@ -22,52 +22,47 @@ metadata:
|
|
|
22
22
|
|
|
23
23
|
## 阶段职责
|
|
24
24
|
|
|
25
|
-
Apply 按 OpenSpec tasks
|
|
25
|
+
Apply 按 OpenSpec tasks 实现,负责 RED/GREEN 证据、任务勾选和 review request-changes 后的 reopen 修复;不扩大范围,不改 proposal package 语义。
|
|
26
26
|
|
|
27
27
|
## 第一条必跑命令
|
|
28
28
|
|
|
29
29
|
```text
|
|
30
|
-
superspec
|
|
30
|
+
superspec check workflow-packet --change "<change>" --gate apply_ready --format agent
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
遇到任何返回状态为 `block` 就停止;未 allowed 前不要编辑实现。
|
|
34
34
|
|
|
35
35
|
## OpenSpec 边界
|
|
36
36
|
|
|
37
37
|
- 直接使用 OpenSpec CLI surface,不读取 repo-local `openspec-*` skill 文本。
|
|
38
|
-
- task list、`contextFiles`、progress
|
|
38
|
+
- task list、`contextFiles`、progress、dynamic instruction 来自:
|
|
39
39
|
|
|
40
40
|
```text
|
|
41
41
|
openspec instructions apply --change "<change>" --json
|
|
42
42
|
```
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
不要发明 task list,也不要跳过 OpenSpec 返回的 context files。
|
|
45
45
|
|
|
46
46
|
## Task Guard 边界
|
|
47
47
|
|
|
48
|
-
实现编辑前读取 task
|
|
48
|
+
实现编辑前读取 `task_edit` 检查结果;勾选 task 前读取 `task_complete` 检查结果:
|
|
49
49
|
|
|
50
50
|
```text
|
|
51
|
-
superspec
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
勾选 task 前读取 completion packet:
|
|
55
|
-
|
|
56
|
-
```text
|
|
57
|
-
superspec guard workflow-packet --change "<change>" --gate task_complete --task-id "<task-id>" --format agent
|
|
51
|
+
superspec check workflow-packet --change "<change>" --gate task_edit --task-id "<task-id>" --format agent
|
|
52
|
+
superspec check workflow-packet --change "<change>" --gate task_complete --task-id "<task-id>" --format agent
|
|
58
53
|
```
|
|
59
54
|
|
|
60
55
|
`task_edit` 未 allowed 不得编辑实现;`task_complete` 未 allowed 不得把 checkbox 改成 done。
|
|
61
56
|
|
|
62
57
|
## Reopen 边界
|
|
63
58
|
|
|
64
|
-
|
|
59
|
+
review 给出 `request_changes_route:"reopen_tasks"` 时,先生成完整 reopen package,再检查:
|
|
65
60
|
|
|
66
61
|
```text
|
|
67
|
-
superspec
|
|
62
|
+
superspec check workflow-packet --change "<change>" --gate task_reopen --task-id "<task-id>" --format agent
|
|
68
63
|
```
|
|
69
64
|
|
|
70
|
-
只有 `task_reopen` allowed 后,才允许把目标 task 从 checked 改回 unchecked 并重新 RED/GREEN
|
|
65
|
+
只有 `task_reopen` allowed 后,才允许把目标 task 从 checked 改回 unchecked 并重新 RED/GREEN。修完写 `task_reopen_resolved`,再进 review。若 route 是 `change_update`,停止 apply 并回 propose/change update。
|
|
71
66
|
|
|
72
67
|
## 用户确认边界
|
|
73
68
|
|
|
@@ -75,44 +70,74 @@ superspec guard workflow-packet --change "<change>" --gate task_reopen --task-id
|
|
|
75
70
|
- 分支状态、dirty worktree、scope expands 或需要改变 task scope 时必须停止并确认。
|
|
76
71
|
- 不要使用默认值、历史偏好或沉默作为确认。
|
|
77
72
|
|
|
78
|
-
##
|
|
73
|
+
## 专用代理边界
|
|
74
|
+
|
|
75
|
+
主线程只负责用检查命令生成各角色提示、分派专用代理、审核代理报告、登记证据、推进任务勾选。专用代理来自 `.codex/agents/*.toml` 与 `.codex/prompts/*.md`,不能由主线程自审替代。代理报告只是候选材料,通过检查的才是正式证据。当前 CLI 没有登记证据的命令;代理报告返回后,由主线程按检查命令的 output contract 字段手动写入 `.superspec/evidence/` 对应目录。
|
|
76
|
+
|
|
77
|
+
RED/characterization/GREEN 测试必须由 `.codex/agents/test-runner.toml` + `.codex/prompts/test-runner.md` 执行;主线程不得代跑或伪造 formal `test_run` evidence。新增或修改测试文件时用 `test-engineer` 专用代理。
|
|
78
|
+
|
|
79
|
+
```text
|
|
80
|
+
superspec check apply-test-packet --change "<change>" --task-id "<task-id>" --test-id "<test-id>" --phase red --format prompt
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
用 test-runner 执行检查命令指定的测试命令;主线程审核报告/原始日志并登记为证据后,才写正式 `test_run` 证据。
|
|
84
|
+
|
|
85
|
+
测试证据语义(框架无关,审核 worker report 时用):只有 `target test identity executed` 才算有效运行;`command exit code alone is not proof`,退出码 0 不证明目标测试真正跑过/通过;命令在到达测试 runner 之前失败属于 `blocked before the target test runner`,不算 RED/GREEN;`do not classify environment/build failures as RED or GREEN`。
|
|
79
86
|
|
|
80
|
-
|
|
87
|
+
`apply_execution_surface`:缺省有 `write_scope` 为 `implementation`,无 `write_scope` 为 `no_code`;显式允许 `implementation`、`runtime_config`、`docs_generated`、`no_code`。`implementation` / `runtime_config` 必须走 executor-worker chain;`tdd_required:false` 也只能用 closed `apply_worker_chain` 的 `completion_proof_kind:"alternative_verification"` 完成。`docs_generated` / `no_code` 可用 direct alternative/manual verification。
|
|
81
88
|
|
|
82
|
-
|
|
89
|
+
编码实现必须由 `.codex/agents/executor.toml` + `.codex/prompts/executor.md` 执行,并通过 active -> closed `apply_worker_chain` 收敛;主线程不得直接改实现代码来完成 task。
|
|
83
90
|
|
|
84
91
|
```text
|
|
85
|
-
superspec
|
|
92
|
+
superspec check apply-executor-packet --change "<change>" --task-id "<task-id>" --apply-worker-chain-ref "<active-chain-ref>" --format prompt
|
|
86
93
|
```
|
|
87
94
|
|
|
88
|
-
使用 `.codex/agents/
|
|
95
|
+
使用 `.codex/agents/executor.toml` / `.codex/prompts/executor.md`。先把检查命令给出的激活模板登记为工作链证据;缺激活标记不能启动 executor。TDD 与 no-TDD 的激活标记不同(具体字段以检查命令输出为准)。executor 只能改检查命令声明的实现写范围(implementation/runtime_config write scope),不能写正式 evidence,不能改 task checkbox,不能做 review/verification。
|
|
89
96
|
|
|
90
|
-
|
|
97
|
+
executor 返回后把报告登记为证据,再生成任务级审查:
|
|
91
98
|
|
|
92
99
|
```text
|
|
93
|
-
superspec
|
|
100
|
+
superspec check apply-code-review-packet --change "<change>" --task-id "<task-id>" --executor-report-ref "<ref>" --format prompt
|
|
94
101
|
```
|
|
95
102
|
|
|
96
|
-
|
|
103
|
+
用 `.codex/agents/code-reviewer.toml` 检查 scope/protected paths、executor report 与 diff、test/invariant mapping 和 suggested GREEN checks。
|
|
97
104
|
|
|
98
|
-
|
|
105
|
+
code-review 通过后,GREEN 只走同一 executor-worker chain:
|
|
99
106
|
|
|
100
107
|
```text
|
|
101
|
-
superspec
|
|
108
|
+
superspec check apply-test-packet --change "<change>" --task-id "<task-id>" --test-id "<test-id>" --phase green --task-code-review-report-ref "<ref>" --format prompt
|
|
102
109
|
```
|
|
103
110
|
|
|
104
|
-
|
|
111
|
+
GREEN report 审核并登记为 evidence 后,生成 GREEN verification:
|
|
105
112
|
|
|
106
|
-
|
|
113
|
+
```text
|
|
114
|
+
superspec check apply-verify-packet --change "<change>" --task-id "<task-id>" --executor-report-ref "<ref>" --task-code-review-report-ref "<ref>" --green-test-run-evidence-ref "<ref>" --red-test-run-evidence-ref "<ref>" --format prompt
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
no-TDD implementation/runtime_config 先登记 live/pass `alternative_verification` 或 `manual_verification`,再生成 alternative verification:
|
|
107
118
|
|
|
108
119
|
```text
|
|
109
|
-
superspec
|
|
120
|
+
superspec check apply-verify-packet --change "<change>" --task-id "<task-id>" --executor-report-ref "<ref>" --task-code-review-report-ref "<ref>" --alternative-verification-evidence-ref "<ref>" --format prompt
|
|
110
121
|
```
|
|
111
122
|
|
|
112
|
-
GREEN
|
|
123
|
+
用 `.codex/agents/verifier.toml` 检查完成方式分支:GREEN 绑定 RED/characterization、GREEN 和当前工作区;alternative 绑定 no-TDD 激活标记、实际替代/人工验证引用、surface/no-TDD 元数据和当前工作区。审核 verifier 报告后写关闭的工作链证据,再跑 `task_complete`。异常终止只取消旧工作链,不授权完成。
|
|
124
|
+
|
|
125
|
+
## 完成检查
|
|
126
|
+
|
|
127
|
+
每个 task 的证据链(RED/characterization → executor → code-review → GREEN 或替代验证 → verifier)齐全后,运行任务完成检查:
|
|
128
|
+
|
|
129
|
+
```text
|
|
130
|
+
superspec check workflow-packet --change "<change>" --gate task_complete --task-id "<task-id>" --format agent
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
只有检查结果显示通过后,才把该 task 的 checkbox 改为 done。所有 task 完成后进入 `superspec-review`。
|
|
134
|
+
|
|
135
|
+
## 异常恢复
|
|
136
|
+
|
|
137
|
+
状态文件损坏时重建:
|
|
113
138
|
|
|
114
139
|
```text
|
|
115
|
-
superspec
|
|
140
|
+
superspec check recompute --change "<change>" --rebuild-corrupt
|
|
116
141
|
```
|
|
117
142
|
|
|
118
|
-
|
|
143
|
+
状态指纹过期时,重跑对应检查命令即可(检查命令会自动重算并刷新指纹);不要手写状态文件。
|
|
@@ -10,7 +10,7 @@ metadata:
|
|
|
10
10
|
|
|
11
11
|
## 语言规则 / Language
|
|
12
12
|
|
|
13
|
-
-
|
|
13
|
+
- 默认使用简体中文写人类可读内容;命令、路径、字段名、阶段门名、task/test id、代码标识符保留原文。
|
|
14
14
|
- 用户可见文案不得使用“裁决”描述用户动作;统一说“确认”“范围取舍”“处理方式选择”或“用户确认记录”。
|
|
15
15
|
- 不把内部证据种类、reason code、JSON 字段大全直接转述给用户;需要诊断时才引用原文。
|
|
16
16
|
- 普通 workflow 命令使用 `--format agent`;`--format json` 只用于诊断,不作为默认上下文。
|
|
@@ -27,10 +27,10 @@ Archive 在 `review_complete` allowed 后收尾:确认 archive readiness、保
|
|
|
27
27
|
## 第一条必跑命令
|
|
28
28
|
|
|
29
29
|
```text
|
|
30
|
-
superspec
|
|
30
|
+
superspec check workflow-packet --change "<change>" --gate archive_ready --format agent
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
遇到 `block` 就停止,不归档。
|
|
34
34
|
|
|
35
35
|
## OpenSpec 边界
|
|
36
36
|
|
|
@@ -47,7 +47,7 @@ superspec guard workflow-packet --change "<change>" --gate archive_ready --forma
|
|
|
47
47
|
确认后运行会写 preservation manifest 的 readiness check:
|
|
48
48
|
|
|
49
49
|
```text
|
|
50
|
-
superspec
|
|
50
|
+
superspec check check-archive-ready --change "<change>" --format agent
|
|
51
51
|
```
|
|
52
52
|
|
|
53
53
|
然后运行 OpenSpec archive:
|
|
@@ -59,7 +59,7 @@ openspec archive -y "<change>"
|
|
|
59
59
|
最后验证 archived sidecar preservation:
|
|
60
60
|
|
|
61
61
|
```text
|
|
62
|
-
superspec
|
|
62
|
+
superspec check check-archived --change "<change>" --format agent
|
|
63
63
|
```
|
|
64
64
|
|
|
65
65
|
`.superspec/artifacts/business-invariants.md`、`.superspec/artifacts/test-contract.md`、review/verification evidence、RED/GREEN evidence 和 archive evidence 必须能从 preservation manifest 追溯。
|
|
@@ -10,7 +10,7 @@ metadata:
|
|
|
10
10
|
|
|
11
11
|
## 语言规则 / Language
|
|
12
12
|
|
|
13
|
-
-
|
|
13
|
+
- 默认使用简体中文写人类可读内容;命令、路径、字段名、阶段门名、task/test id、代码标识符保留原文。
|
|
14
14
|
- 用户可见文案不得使用“裁决”描述用户动作;统一说“确认”“范围取舍”“处理方式选择”或“用户确认记录”。
|
|
15
15
|
- 不把内部证据种类、reason code、JSON 字段大全直接转述给用户;需要诊断时才引用原文。
|
|
16
16
|
- 普通 workflow 命令使用 `--format agent`;`--format json` 只用于诊断,不作为默认上下文。
|
|
@@ -24,6 +24,11 @@ metadata:
|
|
|
24
24
|
|
|
25
25
|
Explore 只做需求澄清、代码事实调查、范围边界和风险记录。产物是 `openspec/changes/<change>/.superspec/artifacts/discovery.md`;不写 `proposal.md`、`specs/**`、`design.md`、`tasks.md`,也不改实现代码。
|
|
26
26
|
|
|
27
|
+
## 产物格式
|
|
28
|
+
|
|
29
|
+
- discovery.md 必须按 SuperSpec discovery 模板的结构填写,保留全部段落:`调查范围` / `现有实现事实` / `隐性合约` / `风险与歧义` / `待确认问题` / `Subagent Evidence`;不得自创或删减段落骨架。
|
|
30
|
+
- 第一条必跑命令 `superspec check workflow-packet --change "<change>" --gate explore_complete --format agent` 的返回里带 `discovery_template` 与 `discovery_rules`:按其中的模板骨架和填写规则产出,而不是自由发挥,这样无论哪个模型产物结构都一致。
|
|
31
|
+
|
|
27
32
|
## 第一条必跑命令
|
|
28
33
|
|
|
29
34
|
```text
|
|
@@ -35,11 +40,11 @@ superspec init --scope project --format agent
|
|
|
35
40
|
```text
|
|
36
41
|
openspec list --json
|
|
37
42
|
openspec status --change "<change>" --json
|
|
38
|
-
superspec
|
|
39
|
-
superspec
|
|
43
|
+
superspec check check-init --change "<change>" --format agent
|
|
44
|
+
superspec check workflow-packet --change "<change>" --gate explore_complete --format agent
|
|
40
45
|
```
|
|
41
46
|
|
|
42
|
-
|
|
47
|
+
遇到 `block` 就停止,按检查结果的下一步提示处理;不要绕过检查。
|
|
43
48
|
|
|
44
49
|
## OpenSpec 边界
|
|
45
50
|
|
|
@@ -48,32 +53,33 @@ superspec guard workflow-packet --change "<change>" --gate explore_complete --fo
|
|
|
48
53
|
- OpenSpec 负责 change 结构和后续 artifact 语义;本阶段只补 SuperSpec discovery 证据。
|
|
49
54
|
- 如果发现需要正式方案、规格、设计或任务,先写入 discovery,再交给 `superspec-propose`。
|
|
50
55
|
|
|
51
|
-
##
|
|
56
|
+
## 专用代理边界
|
|
52
57
|
|
|
53
|
-
|
|
58
|
+
需求审查由本仓库的 `critic` 专用代理完成。生成审查提示时使用检查命令的输出,而不是把披露协议常驻在 skill 正文:
|
|
54
59
|
|
|
55
60
|
```text
|
|
56
|
-
superspec
|
|
61
|
+
superspec check review-packet --change "<change>" --gate explore_complete --role critic --round 1 --format prompt
|
|
57
62
|
```
|
|
58
63
|
|
|
59
|
-
|
|
64
|
+
主流程整理审查问题时读取主线程提示信息:
|
|
60
65
|
|
|
61
66
|
```text
|
|
62
|
-
superspec
|
|
67
|
+
superspec check review-packet --change "<change>" --gate explore_complete --role main-thread --round 1 --format agent
|
|
63
68
|
```
|
|
64
69
|
|
|
65
|
-
|
|
70
|
+
第二轮及以后的审查,必须由检查命令把上一轮的问题注入提示;不要手写历史问题清单。
|
|
66
71
|
|
|
67
72
|
## 用户确认边界
|
|
68
73
|
|
|
69
74
|
- 关键范围、非目标、验收标准、业务语义或设计边界问题必须面向用户说明并等待明确确认。
|
|
70
75
|
- 探索结论、范围边界和进入 propose 的授权必须等待用户确认后再记录 evidence。
|
|
76
|
+
- discovery.md 必须含 `## 待确认问题` 段(标题含「确认」字样即可,如「待确认问题」「需要用户确认的问题」)。每条问题用 `- [ ]`(未决)或 `- [x]`(已确认)标记;也可在已确认项写「已确认:」。**该段只要还有 `- [ ]` 或「仍需确认/待确认」项,`explore_complete` 检查就不会通过**,不得记录人工确认,也不得进入 propose。
|
|
71
77
|
- 用户看到的文字要用中文业务语言;内部 JSON 名只写进证据、命令输出或诊断片段。
|
|
72
78
|
|
|
73
79
|
## 完成检查
|
|
74
80
|
|
|
75
81
|
```text
|
|
76
|
-
superspec
|
|
82
|
+
superspec check workflow-packet --change "<change>" --gate explore_complete --format agent
|
|
77
83
|
```
|
|
78
84
|
|
|
79
|
-
|
|
85
|
+
只有检查结果显示通过后,才进入 `superspec-propose`。
|
|
@@ -10,7 +10,7 @@ metadata:
|
|
|
10
10
|
|
|
11
11
|
## 语言规则 / Language
|
|
12
12
|
|
|
13
|
-
-
|
|
13
|
+
- 默认使用简体中文写人类可读内容;命令、路径、字段名、阶段门名、task/test id、代码标识符保留原文。
|
|
14
14
|
- 用户可见文案不得使用“裁决”描述用户动作;统一说“确认”“范围取舍”“处理方式选择”或“用户确认记录”。
|
|
15
15
|
- 不把内部证据种类、reason code、JSON 字段大全直接转述给用户;需要诊断时才引用原文。
|
|
16
16
|
- 普通 workflow 命令使用 `--format agent`;`--format json` 只用于诊断,不作为默认上下文。
|
|
@@ -27,10 +27,10 @@ Propose 把 discovery 转成 OpenSpec proposal package,并补 SuperSpec 业务
|
|
|
27
27
|
## 第一条必跑命令
|
|
28
28
|
|
|
29
29
|
```text
|
|
30
|
-
superspec
|
|
30
|
+
superspec check workflow-packet --change "<change>" --gate explore_complete --format agent
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
遇到 `block` 就停止,回 explore 阶段补事实或确认。
|
|
34
34
|
|
|
35
35
|
## OpenSpec 边界
|
|
36
36
|
|
|
@@ -42,39 +42,50 @@ superspec guard workflow-packet --change "<change>" --gate explore_complete --fo
|
|
|
42
42
|
openspec instructions <artifact-id> --change "<change>" --json
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
+
## 执行步骤
|
|
46
|
+
|
|
47
|
+
把 discovery 整理成 OpenSpec proposal package,每个正本 artifact 都通过 OpenSpec 产出引擎生成:
|
|
48
|
+
|
|
49
|
+
1. 运行 `openspec status --change "<change>" --json`,取 artifact 顺序、状态和 `resolvedOutputPath`。
|
|
50
|
+
2. 每个 artifact(proposal/specs/design/tasks)运行 `openspec instructions <artifact-id> --change "<change>" --json`,取回 template/rules/context/instruction/dependencies。
|
|
51
|
+
3. 先读 dependencies 列出的已完成 artifact,再按 template 写到 `resolvedOutputPath`;context/rules 是对作者的约束,不写进产出文件。
|
|
52
|
+
4. sidecar(`.superspec/artifacts/business-invariants.md`、`.superspec/artifacts/test-contract.md`)用 SuperSpec 内置模板,写到 change 内 `.superspec/artifacts/`。
|
|
53
|
+
|
|
45
54
|
## Packet 驱动的阶段门
|
|
46
55
|
|
|
47
|
-
按 artifact
|
|
56
|
+
按 artifact 依赖顺序工作,每个门都先读检查结果,通过后才进入下一段:
|
|
48
57
|
|
|
49
58
|
```text
|
|
50
|
-
superspec
|
|
51
|
-
superspec
|
|
52
|
-
superspec
|
|
53
|
-
superspec
|
|
54
|
-
superspec
|
|
55
|
-
superspec
|
|
59
|
+
superspec check workflow-packet --change "<change>" --gate proposal_reviewed --format agent
|
|
60
|
+
superspec check workflow-packet --change "<change>" --gate design_complete --format agent
|
|
61
|
+
superspec check workflow-packet --change "<change>" --gate invariants_reviewed --format agent
|
|
62
|
+
superspec check workflow-packet --change "<change>" --gate test_contract_drafted --format agent
|
|
63
|
+
superspec check workflow-packet --change "<change>" --gate test_contract_honored --format agent
|
|
64
|
+
superspec check workflow-packet --change "<change>" --gate tasks_complete --format agent
|
|
65
|
+
superspec check workflow-packet --change "<change>" --gate propose_complete --format agent
|
|
66
|
+
superspec check workflow-packet --change "<change>" --gate apply_ready --format agent
|
|
56
67
|
```
|
|
57
68
|
|
|
58
|
-
`proposal_reviewed` 不是 advisory note;它是硬门。`propose.proposal_reviewed`、`propose.design_reviewed`、`propose.invariants_reviewed`、`propose.test_plan_drafted`、`propose.tasks_mapped`
|
|
69
|
+
`proposal_reviewed` 不是 advisory note;它是硬门。`propose.proposal_reviewed`、`propose.design_reviewed`、`propose.invariants_reviewed`、`propose.test_plan_drafted`、`propose.tasks_mapped` 是兼容别名,检查结果输出中的规范阶段门名为准。
|
|
59
70
|
|
|
60
|
-
##
|
|
71
|
+
## 专用代理边界
|
|
61
72
|
|
|
62
73
|
- proposal review 使用 repo-local `critic`。
|
|
63
74
|
- design review 使用 repo-local `architect`、`critic`、`test-engineer`。
|
|
64
75
|
- business-invariants 和 test-contract review 使用 repo-local `critic` / `test-engineer`。
|
|
65
76
|
- reviewer prompt 一律由 `review-packet --format prompt` 生成;主线程 digest 输入一律由 `review-packet --role main-thread --format agent` 读取。
|
|
66
|
-
-
|
|
77
|
+
- 第二轮及以后的审查,必须由检查命令把上一轮的问题注入提示,不手写历史 finding 清单。
|
|
67
78
|
|
|
68
79
|
## 用户确认边界
|
|
69
80
|
|
|
70
|
-
关键范围、非目标、验收标准、业务语义和设计边界问题必须停止并交给用户确认。主线程不能静默关闭这类 finding;需要回 explore 或回上游 artifact
|
|
81
|
+
关键范围、非目标、验收标准、业务语义和设计边界问题必须停止并交给用户确认。主线程不能静默关闭这类 finding;需要回 explore 或回上游 artifact 时,按检查结果和阶段检查给出的回退路径处理。
|
|
71
82
|
|
|
72
83
|
设计选项选择、任务审查确认,以及任何会改变范围或验收标准的处理,都必须等待明确用户确认。
|
|
73
84
|
|
|
74
85
|
## 完成检查
|
|
75
86
|
|
|
76
87
|
```text
|
|
77
|
-
superspec
|
|
88
|
+
superspec check workflow-packet --change "<change>" --gate apply_ready --format agent
|
|
78
89
|
```
|
|
79
90
|
|
|
80
91
|
只有 apply-ready allowed 后,才进入 `superspec-apply`。
|
|
@@ -10,7 +10,7 @@ metadata:
|
|
|
10
10
|
|
|
11
11
|
## 语言规则 / Language
|
|
12
12
|
|
|
13
|
-
-
|
|
13
|
+
- 默认使用简体中文写人类可读内容;命令、路径、字段名、阶段门名、task/test id、代码标识符保留原文。
|
|
14
14
|
- 用户可见文案不得使用“裁决”描述用户动作;统一说“确认”“范围取舍”“处理方式选择”或“用户确认记录”。
|
|
15
15
|
- 不把内部证据种类、reason code、JSON 字段大全直接转述给用户;需要诊断时才引用原文。
|
|
16
16
|
- 普通 workflow 命令使用 `--format agent`;`--format json` 只用于诊断,不作为默认上下文。
|
|
@@ -27,20 +27,20 @@ Review 合并实现审查、架构审查、SuperSpec critic、final verification
|
|
|
27
27
|
## 第一条必跑命令
|
|
28
28
|
|
|
29
29
|
```text
|
|
30
|
-
superspec
|
|
30
|
+
superspec check check-init --change "<change>" --format agent
|
|
31
31
|
```
|
|
32
32
|
|
|
33
33
|
然后检查 review readiness:
|
|
34
34
|
|
|
35
35
|
```text
|
|
36
|
-
superspec
|
|
36
|
+
superspec check check-review-ready --change "<change>" --format agent
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
遇到任何返回状态为 `block` 就停止。review 不直接回改 `tasks.md` checkbox。
|
|
40
40
|
|
|
41
|
-
##
|
|
41
|
+
## 专用代理边界
|
|
42
42
|
|
|
43
|
-
Review
|
|
43
|
+
Review 必须使用本仓库安装的 repo-local native agents(专用代理),不要调用全局 `$code-review`、OMX workflow、主线程自审或普通 markdown 报告替代。
|
|
44
44
|
|
|
45
45
|
必需入口:
|
|
46
46
|
|
|
@@ -49,12 +49,12 @@ Review 必须使用 SuperSpec 分发包里的 repo-local native agents,不要
|
|
|
49
49
|
- `.codex/agents/critic.toml` / `.codex/prompts/critic.md`
|
|
50
50
|
- `.codex/agents/verifier.toml` / `.codex/prompts/verifier.md`
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
每个审查提示都先由检查命令产出:
|
|
53
53
|
|
|
54
54
|
```text
|
|
55
|
-
superspec
|
|
56
|
-
superspec
|
|
57
|
-
superspec
|
|
55
|
+
superspec check review-packet --change "<change>" --gate review_complete --role code-reviewer --round 1 --format prompt
|
|
56
|
+
superspec check review-packet --change "<change>" --gate review_complete --role architect --round 1 --format prompt
|
|
57
|
+
superspec check review-packet --change "<change>" --gate review_complete --role critic --round 1 --format prompt
|
|
58
58
|
```
|
|
59
59
|
|
|
60
60
|
## Final Verification 边界
|
|
@@ -65,11 +65,11 @@ superspec guard review-packet --change "<change>" --gate review_complete --role
|
|
|
65
65
|
openspec validate "<change>"
|
|
66
66
|
```
|
|
67
67
|
|
|
68
|
-
然后执行 test contract
|
|
68
|
+
然后执行 test contract 要求的最终测试,启动本仓库 `verifier` 和 `critic` 做验证审查。验证提示也必须由检查命令产出:
|
|
69
69
|
|
|
70
70
|
```text
|
|
71
|
-
superspec
|
|
72
|
-
superspec
|
|
71
|
+
superspec check review-packet --change "<change>" --gate review_complete --role verifier --round 1 --format prompt
|
|
72
|
+
superspec check review-packet --change "<change>" --gate review_complete --role critic --round 1 --kind verification_review --format prompt
|
|
73
73
|
```
|
|
74
74
|
|
|
75
75
|
verification 只提供 proof/gap,不替代主流程最终判断。
|
|
@@ -79,10 +79,10 @@ verification 只提供 proof/gap,不替代主流程最终判断。
|
|
|
79
79
|
主线程写最终判断前读取:
|
|
80
80
|
|
|
81
81
|
```text
|
|
82
|
-
superspec
|
|
82
|
+
superspec check review-packet --change "<change>" --gate review_complete --role main-thread --round 1 --format agent
|
|
83
83
|
```
|
|
84
84
|
|
|
85
|
-
`review_complete`
|
|
85
|
+
`review_complete` 是只允许通过的阶段检查。通过路径由主线程写本轮审查结论(主线程直接写,不携带代理字段)。
|
|
86
86
|
|
|
87
87
|
`request_changes` 不是 review_complete allow。它必须写清 `request_changes_route`:
|
|
88
88
|
|
|
@@ -96,7 +96,7 @@ request-changes round 不生成 allow-path verification,也不调用 `check-re
|
|
|
96
96
|
仅 allow path 运行:
|
|
97
97
|
|
|
98
98
|
```text
|
|
99
|
-
superspec
|
|
99
|
+
superspec check workflow-packet --change "<change>" --gate review_complete --format agent
|
|
100
100
|
```
|
|
101
101
|
|
|
102
|
-
|
|
102
|
+
只有检查结果显示通过后,才进入 `superspec-archive`。
|