@peterxiaoyang/superspec 0.1.5 → 0.1.7
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/adapters/codex/agents/code-reviewer.toml +2 -2
- package/adapters/codex/agents/executor.toml +13 -0
- package/adapters/codex/agents/test-runner.toml +13 -0
- package/adapters/codex/agents/verifier.toml +2 -2
- package/adapters/codex/install-map.json +20 -0
- package/dist/src/apply_worker_chain.d.ts +57 -0
- package/dist/src/apply_worker_chain.js +1188 -0
- package/dist/src/apply_worker_chain_lifecycle.d.ts +19 -0
- package/dist/src/apply_worker_chain_lifecycle.js +278 -0
- package/dist/src/cli_args.d.ts +8 -0
- package/dist/src/cli_args.js +121 -5
- package/dist/src/core.d.ts +1 -0
- package/dist/src/core.js +1 -0
- package/dist/src/evidence.js +152 -0
- package/dist/src/gates.d.ts +1 -0
- package/dist/src/gates.js +21 -1
- package/dist/src/install_engine.d.ts +17 -0
- package/dist/src/install_engine.js +125 -2
- package/dist/src/packet_measure.js +27 -5
- package/dist/src/packet_render.js +892 -2
- package/dist/src/packet_schema.d.ts +2 -1
- package/dist/src/tasks.d.ts +10 -0
- package/dist/src/tasks.js +86 -0
- package/dist/src/util.d.ts +1 -1
- package/dist/src/util.js +3 -0
- package/package.json +1 -1
- package/schemas/install-manifest.schema.json +17 -0
- package/templates/workflow/prompts/code-reviewer.md +7 -1
- package/templates/workflow/prompts/executor.md +32 -0
- package/templates/workflow/prompts/test-runner.md +33 -0
- package/templates/workflow/prompts/verifier.md +7 -1
- package/templates/workflow/skills/superspec-apply/SKILL.md +39 -1
|
@@ -46,9 +46,10 @@ export type ReviewPacket = {
|
|
|
46
46
|
required_review_scope?: string[];
|
|
47
47
|
stop_conditions: string[];
|
|
48
48
|
};
|
|
49
|
+
export type ApplyWorkerPacket = Record<string, any>;
|
|
49
50
|
export type PacketDispatchResult = {
|
|
50
51
|
output_format: "agent";
|
|
51
|
-
payload: WorkflowPacket | ReviewPacket;
|
|
52
|
+
payload: WorkflowPacket | ReviewPacket | ApplyWorkerPacket;
|
|
52
53
|
} | {
|
|
53
54
|
output_format: "prompt";
|
|
54
55
|
payload: string;
|
package/dist/src/tasks.d.ts
CHANGED
|
@@ -5,12 +5,22 @@ export type TestContractRecord = {
|
|
|
5
5
|
scenario_ref: string;
|
|
6
6
|
invariant_refs: string[];
|
|
7
7
|
};
|
|
8
|
+
export type TestCommandResolution = {
|
|
9
|
+
test_id: string;
|
|
10
|
+
command: string | null;
|
|
11
|
+
source: "test_command" | "test_command_ref" | null;
|
|
12
|
+
command_ref?: string;
|
|
13
|
+
expected_failure_signature?: string;
|
|
14
|
+
expected_failure_classifier?: string;
|
|
15
|
+
blockers: Reason[];
|
|
16
|
+
};
|
|
8
17
|
export declare function parse_tasks(changeRoot: string): Record<string, TaskInfo>;
|
|
9
18
|
export declare function tasks_structure_hash(changeRoot: string): string | null;
|
|
10
19
|
export declare function splitList(value: string): string[];
|
|
11
20
|
export declare function parse_test_contract_records(changeRoot: string): TestContractRecord[];
|
|
12
21
|
export declare function parse_test_contract_ids(changeRoot: string): Set<string>;
|
|
13
22
|
export declare function test_contract_text(changeRoot: string): string;
|
|
23
|
+
export declare function resolve_test_contract_command(changeRoot: string, testId: string, config?: JsonMap): TestCommandResolution;
|
|
14
24
|
export declare function parse_spec_scenarios(changeRoot: string): string[];
|
|
15
25
|
export declare function test_contract_covers_scenario(changeRoot: string, scenario: string): boolean;
|
|
16
26
|
export declare function test_contract_invariant_refs_by_test(changeRoot: string): Map<string, Set<string>>;
|
package/dist/src/tasks.js
CHANGED
|
@@ -120,6 +120,92 @@ export function test_contract_text(changeRoot) {
|
|
|
120
120
|
return "";
|
|
121
121
|
return readFileSync(filePath, "utf8");
|
|
122
122
|
}
|
|
123
|
+
function test_contract_section_lines(changeRoot, testId) {
|
|
124
|
+
const lines = test_contract_text(changeRoot).split(/\r?\n/);
|
|
125
|
+
const start = lines.findIndex((line) => {
|
|
126
|
+
const match = line.trim().match(/^###\s+(\S+)\s*$/);
|
|
127
|
+
return match?.[1] === testId;
|
|
128
|
+
});
|
|
129
|
+
if (start < 0)
|
|
130
|
+
return [];
|
|
131
|
+
const out = [];
|
|
132
|
+
for (const line of lines.slice(start + 1)) {
|
|
133
|
+
if (/^###\s+\S+/.test(line.trim()) || /^##\s+/.test(line.trim()))
|
|
134
|
+
break;
|
|
135
|
+
out.push(line);
|
|
136
|
+
}
|
|
137
|
+
return out;
|
|
138
|
+
}
|
|
139
|
+
function contractField(line) {
|
|
140
|
+
const match = line.match(/^\s*-\s+`?([A-Za-z0-9_-]+)`?\s*:\s*(.*)$/);
|
|
141
|
+
if (!match)
|
|
142
|
+
return null;
|
|
143
|
+
return { key: match[1], value: match[2].trim() };
|
|
144
|
+
}
|
|
145
|
+
export function resolve_test_contract_command(changeRoot, testId, config = {}) {
|
|
146
|
+
const blockers = [];
|
|
147
|
+
const lines = test_contract_section_lines(changeRoot, testId);
|
|
148
|
+
if (lines.length === 0) {
|
|
149
|
+
return { test_id: testId, command: null, source: null, blockers: [reason("missing_test_contract_section", `test contract missing ### ${testId} section`)] };
|
|
150
|
+
}
|
|
151
|
+
const fields = new Map();
|
|
152
|
+
for (const line of lines) {
|
|
153
|
+
const field = contractField(line);
|
|
154
|
+
if (!field)
|
|
155
|
+
continue;
|
|
156
|
+
const values = fields.get(field.key) ?? [];
|
|
157
|
+
values.push(field.value);
|
|
158
|
+
fields.set(field.key, values);
|
|
159
|
+
}
|
|
160
|
+
const commands = fields.get("test_command") ?? [];
|
|
161
|
+
const refs = fields.get("test_command_ref") ?? [];
|
|
162
|
+
if (commands.length === 0 && refs.length === 0)
|
|
163
|
+
blockers.push(reason("missing_test_command", `test contract ${testId} requires exactly one test_command or test_command_ref`));
|
|
164
|
+
if (commands.length > 1 || refs.length > 1)
|
|
165
|
+
blockers.push(reason("duplicate_test_command", `test contract ${testId} has duplicate test command fields`));
|
|
166
|
+
if (commands.length > 0 && refs.length > 0)
|
|
167
|
+
blockers.push(reason("ambiguous_test_command", `test contract ${testId} must not mix test_command and test_command_ref`));
|
|
168
|
+
const expected_failure_signature = (fields.get("expected_failure_signature") ?? [])[0];
|
|
169
|
+
const expected_failure_classifier = (fields.get("expected_failure_classifier") ?? [])[0];
|
|
170
|
+
if (commands.length === 1 && refs.length === 0) {
|
|
171
|
+
const command = commands[0];
|
|
172
|
+
if (!command)
|
|
173
|
+
blockers.push(reason("missing_test_command", `test contract ${testId} has empty test_command`));
|
|
174
|
+
return {
|
|
175
|
+
test_id: testId,
|
|
176
|
+
command: command || null,
|
|
177
|
+
source: command ? "test_command" : null,
|
|
178
|
+
expected_failure_signature,
|
|
179
|
+
expected_failure_classifier,
|
|
180
|
+
blockers,
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
if (refs.length === 1 && commands.length === 0) {
|
|
184
|
+
const refValue = refs[0];
|
|
185
|
+
const match = refValue.match(/^config\.commands\.([A-Za-z0-9_.-]+)$/);
|
|
186
|
+
if (!match) {
|
|
187
|
+
blockers.push(reason("untrusted_test_command_ref", `test contract ${testId} test_command_ref must be config.commands.<id>`));
|
|
188
|
+
return { test_id: testId, command: null, source: null, command_ref: refValue, expected_failure_signature, expected_failure_classifier, blockers };
|
|
189
|
+
}
|
|
190
|
+
const commandId = match[1];
|
|
191
|
+
const commandsConfig = config.commands;
|
|
192
|
+
const command = commandsConfig && typeof commandsConfig === "object" ? commandsConfig[commandId] : undefined;
|
|
193
|
+
if (typeof command !== "string" || !command.trim()) {
|
|
194
|
+
blockers.push(reason("untrusted_test_command_ref", `test contract ${testId} test_command_ref ${refValue} does not resolve to config.commands.${commandId}`));
|
|
195
|
+
return { test_id: testId, command: null, source: null, command_ref: refValue, expected_failure_signature, expected_failure_classifier, blockers };
|
|
196
|
+
}
|
|
197
|
+
return {
|
|
198
|
+
test_id: testId,
|
|
199
|
+
command,
|
|
200
|
+
source: "test_command_ref",
|
|
201
|
+
command_ref: refValue,
|
|
202
|
+
expected_failure_signature,
|
|
203
|
+
expected_failure_classifier,
|
|
204
|
+
blockers,
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
return { test_id: testId, command: null, source: null, expected_failure_signature, expected_failure_classifier, blockers };
|
|
208
|
+
}
|
|
123
209
|
export function parse_spec_scenarios(changeRoot) {
|
|
124
210
|
const specs = join(changeRoot, "specs");
|
|
125
211
|
const scenarios = [];
|
package/dist/src/util.d.ts
CHANGED
|
@@ -75,7 +75,7 @@ export declare const FORBIDDEN_FIELDS: Set<string>;
|
|
|
75
75
|
export declare const OPENSPEC_ARTIFACTS: Set<string>;
|
|
76
76
|
export declare const REQUIRED_OPENSPEC_CODEX_SKILLS: readonly [];
|
|
77
77
|
export declare const REQUIRED_SUPERSPEC_WORKFLOW_SKILLS: readonly ["superspec-explore", "superspec-propose", "superspec-apply", "superspec-review", "superspec-archive"];
|
|
78
|
-
export declare const REQUIRED_SUPERSPEC_AGENT_ROLES: readonly ["architect", "critic", "test-engineer", "code-reviewer", "verifier"];
|
|
78
|
+
export declare const REQUIRED_SUPERSPEC_AGENT_ROLES: readonly ["architect", "critic", "executor", "test-runner", "test-engineer", "code-reviewer", "verifier"];
|
|
79
79
|
export declare const REQUIRED_OPENSPEC_CLI_SURFACES: readonly [readonly ["list", "--help"], readonly ["instructions", "--help"], readonly ["archive", "--help"], readonly ["validate", "--help"], readonly ["status", "--help"]];
|
|
80
80
|
export declare const ARTIFACT_ENTER_GATE: Record<string, string>;
|
|
81
81
|
export declare const ROUTE_ORDER: Record<string, number>;
|
package/dist/src/util.js
CHANGED
|
@@ -64,6 +64,7 @@ export const EVIDENCE_KINDS = new Set([
|
|
|
64
64
|
"test_run",
|
|
65
65
|
"alternative_verification",
|
|
66
66
|
"manual_verification",
|
|
67
|
+
"apply_worker_chain",
|
|
67
68
|
"task_reopen",
|
|
68
69
|
"task_reopen_resolved",
|
|
69
70
|
"human_confirmation",
|
|
@@ -162,6 +163,8 @@ export const REQUIRED_SUPERSPEC_WORKFLOW_SKILLS = [
|
|
|
162
163
|
export const REQUIRED_SUPERSPEC_AGENT_ROLES = [
|
|
163
164
|
"architect",
|
|
164
165
|
"critic",
|
|
166
|
+
"executor",
|
|
167
|
+
"test-runner",
|
|
165
168
|
"test-engineer",
|
|
166
169
|
"code-reviewer",
|
|
167
170
|
"verifier",
|
package/package.json
CHANGED
|
@@ -75,6 +75,23 @@
|
|
|
75
75
|
"type": "string",
|
|
76
76
|
"minLength": 1
|
|
77
77
|
}
|
|
78
|
+
},
|
|
79
|
+
"configPatch": {
|
|
80
|
+
"type": "object",
|
|
81
|
+
"additionalProperties": false,
|
|
82
|
+
"required": ["path", "retainedOnUninstall", "managed"],
|
|
83
|
+
"properties": {
|
|
84
|
+
"path": {
|
|
85
|
+
"type": "string",
|
|
86
|
+
"minLength": 1
|
|
87
|
+
},
|
|
88
|
+
"retainedOnUninstall": {
|
|
89
|
+
"const": true
|
|
90
|
+
},
|
|
91
|
+
"managed": {
|
|
92
|
+
"const": false
|
|
93
|
+
}
|
|
94
|
+
}
|
|
78
95
|
}
|
|
79
96
|
}
|
|
80
97
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: "代码质量、安全和规格符合性审查角色"
|
|
3
|
-
argument-hint: "
|
|
3
|
+
argument-hint: "任务说明、review-packet 或 apply-code-review-packet prompt_ref"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Code Reviewer
|
|
@@ -20,6 +20,12 @@ argument-hint: "任务说明或 review-packet prompt_ref"
|
|
|
20
20
|
|
|
21
21
|
在 `superspec-review` 中,先读取主流程提供的 `review-packet` 或 `prompt_ref`。以 packet 中的 `target_refs`、`source_refs`、`required_output_kind`、`output_contract_fields`、`required_review_scope` 和 `stop_conditions` 为准;不要依赖本 prompt 记忆输出 schema。
|
|
22
22
|
|
|
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
|
+
|
|
25
|
+
apply worker path 的 report 必须包含 `role:"code-reviewer"`、`origin_packet_fingerprint`、`input_ref_digest`、`source_implementation_fingerprint`、`observed_implementation_fingerprint`、`guard_fingerprint`、executor report pinned ref、actual/changed/untracked files、implementation fingerprint、guard artifact manifest fingerprint、scope/protected verdict、executor mismatch、test/invariant verdict、suggested GREEN ids、raw git status/name-status/path diff refs、risk notes 和 unverified items。
|
|
26
|
+
|
|
27
|
+
遵守 `common_worker_report_policy`:长日志、完整 diff、编译输出和大段生成内容必须作为 artifact refs 返回,不要内联或截断。
|
|
28
|
+
|
|
23
29
|
## 输出风格
|
|
24
30
|
|
|
25
31
|
- 所有用户可见输出必须使用简体中文。
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Apply 阶段受限实现角色"
|
|
3
|
+
argument-hint: "任务说明或 apply-executor-packet prompt_ref"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Executor
|
|
7
|
+
|
|
8
|
+
## 角色身份
|
|
9
|
+
|
|
10
|
+
你是 Executor。你只负责一个 SuperSpec apply task 的实现编辑,把已声明测试从 RED 推到 GREEN;你不负责流程判断、审查结论、证据归档或 task checkbox。
|
|
11
|
+
|
|
12
|
+
## 读写边界
|
|
13
|
+
|
|
14
|
+
- 只能修改 `apply-executor-packet` 中 `declared_task_write_scope` 明确列出的实现路径。
|
|
15
|
+
- 不要修改 `proposal.md`/`design.md`/`tasks.md`/`specs/**`/`.superspec/**`,也不要写正式 evidence、ledger、review report 或 archive artifact。
|
|
16
|
+
- 不要勾选 task,不要运行 change-level review,不要替代 `code-reviewer`、`verifier` 或主流程判断。
|
|
17
|
+
- 如果 write scope 缺失、不安全、上下文不足、测试命令不明确或必须扩大范围,停止并报告 blocker。
|
|
18
|
+
|
|
19
|
+
## SuperSpec Packet 规则
|
|
20
|
+
|
|
21
|
+
先读取主流程提供的 `apply-executor-packet` 或 `prompt_ref`。以 packet 中的 `task_id`、`declared_task_write_scope`、`guard_fingerprint`、`apply_worker_chain_id`、`chain_activation_template`、`openspec_context_file_refs`、`task_refs`、`test_contract_refs`、`common_worker_report_policy` 和 `stop_conditions` 为准。
|
|
22
|
+
|
|
23
|
+
只有主流程已经记录 `chain_activation_template` 为 active `apply_worker_chain` 后,才允许开始实现。不要依赖本 prompt 记忆输出 schema。
|
|
24
|
+
|
|
25
|
+
## 输出风格
|
|
26
|
+
|
|
27
|
+
- 所有用户可见输出必须使用简体中文。
|
|
28
|
+
- 命令、路径、JSON/schema 字段、gate 名称、task/test id、代码标识符保留原文。
|
|
29
|
+
- 结论先行:完成、阻塞或部分完成。
|
|
30
|
+
- 报告必须包含 task id、`apply_worker_chain_id`、`guard_fingerprint`、修改文件、建议的 GREEN 检查、test/invariant 映射、runtime artifact refs、未验证项和残余风险。
|
|
31
|
+
- 报告还必须包含 `role:"executor"`、`origin_packet_fingerprint`、`input_ref_digest`、`source_implementation_fingerprint`、`produced_implementation_fingerprint`;这些字段必须来自 packet / runtime,不要自行发明。
|
|
32
|
+
- 遵守 `common_worker_report_policy`:长日志、完整 diff、编译输出和大段生成内容必须作为 artifact refs 返回,不要内联或截断。
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Apply 阶段受限测试执行角色"
|
|
3
|
+
argument-hint: "任务说明或 apply-test-packet prompt_ref"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Test Runner
|
|
7
|
+
|
|
8
|
+
## 角色身份
|
|
9
|
+
|
|
10
|
+
你是 Test Runner。你只负责一个 SuperSpec apply task 的一个测试阶段,执行 packet 明确允许的测试命令,并把结果作为 evidence candidate 返回;你不判断证据是否能被主流程接收,也不决定 task completion。
|
|
11
|
+
|
|
12
|
+
## 读写边界
|
|
13
|
+
|
|
14
|
+
- 默认只读;不要修改 production code、OpenSpec artifacts、`.superspec/**`、task checkbox、review artifacts 或 archive artifacts。
|
|
15
|
+
- 只能执行 `apply-test-packet` 中的 `allowed_test_command`,不要发明、改写或补充命令。
|
|
16
|
+
- 如果 packet 没有 `allowed_test_command`、`worker_state` 不是 `ready`、命令上下文不足或测试产生未声明副作用,停止并报告 blocker。
|
|
17
|
+
- fixture/snapshot 更新只有在 packet 明确列入 `expected_worktree_side_effects` 时才可接受;否则视为不可接收风险。
|
|
18
|
+
|
|
19
|
+
## SuperSpec Packet 规则
|
|
20
|
+
|
|
21
|
+
先读取主流程提供的 `apply-test-packet` 或 `prompt_ref`。以 packet 中的 `task_id`、`test_id`、`phase`、`expected_semantic_status`、`allowed_test_command`、`guard_fingerprint`、`required_invariant_refs`、`common_worker_report_policy` 和 `stop_conditions` 为准。
|
|
22
|
+
|
|
23
|
+
`phase:"green"` 且 `worker_chain_context:"executor_worker"` 时,必须确认 packet 已绑定 `apply_worker_chain_id` 和 `task_code_review_report_pinned_refs`。不要把测试报告直接写成正式 evidence。
|
|
24
|
+
|
|
25
|
+
## 输出风格
|
|
26
|
+
|
|
27
|
+
- 所有用户可见输出必须使用简体中文。
|
|
28
|
+
- 命令、路径、JSON/schema 字段、gate 名称、task/test id、代码标识符保留原文。
|
|
29
|
+
- 结论先行:测试阶段完成、阻塞或不可接收。
|
|
30
|
+
- 报告必须包含 command、command source、cwd、phase、task id、test id、exit status、semantic status candidate、result summary、runtime raw transcript reference、`repo_head`、pre/post dirty-state summary、changed/untracked files、invariant refs、source refs、guard_fingerprint 和 unverified items。
|
|
31
|
+
- 报告还必须包含 `role:"test-runner"`、`origin_packet_fingerprint`、`input_ref_digest`、`source_implementation_fingerprint`、`observed_implementation_fingerprint`;这些字段必须来自 packet / runtime,不要自行发明。
|
|
32
|
+
- RED packet 带 `expected_failure_signature` 或 `expected_failure_classifier` 时,报告和 raw transcript 必须证明匹配;无关 import/build/env/timeout 失败不能作为有效 RED。
|
|
33
|
+
- 遵守 `common_worker_report_policy`:长日志、完整 diff、编译输出和大段生成内容必须作为 artifact refs 返回,不要内联或截断。
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: "完成证据与验证角色"
|
|
3
|
-
argument-hint: "
|
|
3
|
+
argument-hint: "任务说明、review-packet 或 apply-verify-packet prompt_ref"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Verifier
|
|
@@ -21,6 +21,12 @@ argument-hint: "任务说明或 review-packet prompt_ref"
|
|
|
21
21
|
|
|
22
22
|
必须确认 packet 的 `required_output_kind` 是 `verification_review` 后再输出 verification review。
|
|
23
23
|
|
|
24
|
+
在 apply worker path 中,先读取 `apply-verify-packet`。只读检查 RED/characterization evidence、executor report、task-level code-review report、GREEN evidence、current worktree、scope/protected paths 和 freshness。输出是 post-GREEN verification candidate,不是正式 evidence、自动 completion gate 或 `task_complete.allowed` 替代。
|
|
25
|
+
|
|
26
|
+
apply worker report 必须带 `role:"verifier"`、`origin_packet_fingerprint`、`input_ref_digest`、`source_implementation_fingerprint`、`observed_implementation_fingerprint`、`guard_fingerprint`,并覆盖 packet 要求的 verdicts、freshness、RED/GREEN refs、executor/code-review refs、dirty files、implementation/guard fingerprints、scope/protected/mismatch、raw git/diff refs、risk/stop/unverified items。
|
|
27
|
+
|
|
28
|
+
遵守 `common_worker_report_policy`:长日志、完整 diff、编译输出和大段生成内容用 artifact refs,不内联、不截断。
|
|
29
|
+
|
|
24
30
|
## 输出风格
|
|
25
31
|
|
|
26
32
|
- 所有用户可见输出必须使用简体中文。
|
|
@@ -77,4 +77,42 @@ superspec guard workflow-packet --change "<change>" --gate task_reopen --task-id
|
|
|
77
77
|
|
|
78
78
|
## Native Subagent 边界
|
|
79
79
|
|
|
80
|
-
Apply
|
|
80
|
+
Apply 主流程负责 evidence、审核接收、task checkbox 和 `task_complete`;worker report 只是 candidate。repo-local native agents 必须来自 `.codex/agents/*.toml` 与 `.codex/prompts/*.md`,不能由主线程自审替代。
|
|
81
|
+
|
|
82
|
+
可选 RED/characterization 测试 worker:
|
|
83
|
+
|
|
84
|
+
```text
|
|
85
|
+
superspec guard apply-test-packet --change "<change>" --task-id "<task-id>" --test-id "<test-id>" --phase red --format prompt
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
使用 `.codex/agents/test-runner.toml` / `.codex/prompts/test-runner.md` 执行 packet 指定命令。主线程审查 test-runner report 和 raw transcript,materialize 为 pinned refs 后,才写正式 `test_run` evidence。
|
|
89
|
+
|
|
90
|
+
可选 executor-worker chain:
|
|
91
|
+
|
|
92
|
+
```text
|
|
93
|
+
superspec guard apply-executor-packet --change "<change>" --task-id "<task-id>" --apply-worker-chain-ref "<active-chain-ref>" --format prompt
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
使用 `.codex/agents/executor.toml` / `.codex/prompts/executor.md`。先记录 packet 的 `chain_activation_template` 为 active `apply_worker_chain` evidence;缺 active marker 不得 spawn executor。executor 只能改 packet 声明的 implementation write scope,不能写正式 evidence、不能改 task checkbox、不能做 review/verification。
|
|
97
|
+
|
|
98
|
+
executor 返回后先 materialize executor report pinned ref,再生成 task-level review:
|
|
99
|
+
|
|
100
|
+
```text
|
|
101
|
+
superspec guard apply-code-review-packet --change "<change>" --task-id "<task-id>" --executor-report-ref "<ref>" --format prompt
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
用 `.codex/agents/code-reviewer.toml` 检查明显缺陷、scope/protected paths、executor report 与 diff 一致性、test/invariant mapping 和 suggested GREEN checks。code-reviewer report 不是 correctness proof。
|
|
105
|
+
|
|
106
|
+
code-review 审核通过后,GREEN 只走同一 executor-worker chain:
|
|
107
|
+
|
|
108
|
+
```text
|
|
109
|
+
superspec guard apply-test-packet --change "<change>" --task-id "<task-id>" --test-id "<test-id>" --phase green --task-code-review-report-ref "<ref>" --format prompt
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
GREEN report 经主线程审核通过并登记为正式 evidence 后,生成 post-GREEN verification:
|
|
113
|
+
|
|
114
|
+
```text
|
|
115
|
+
superspec guard 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
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
用 `.codex/agents/verifier.toml` 检查 RED/characterization -> executor -> code-review -> GREEN -> current worktree 的证据链和 freshness。verifier report 经主线程审核通过后写 closed `apply_worker_chain` evidence,再运行 `task_complete`。中途转串行 fallback 前,先写 abandoned `apply_worker_chain` evidence,并保留恢复或 serial takeover baseline proof。
|