@peterxiaoyang/superspec 0.1.13 → 0.1.15-alpha
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/dist/cli.d.ts +2 -0
- package/dist/cli.js +302 -0
- package/dist/format.d.ts +29 -0
- package/dist/format.js +141 -0
- package/dist/next.d.ts +3 -0
- package/dist/next.js +161 -0
- package/dist/openspec.d.ts +9 -0
- package/dist/openspec.js +41 -0
- package/dist/record.d.ts +20 -0
- package/dist/record.js +211 -0
- package/dist/skill_loop.d.ts +23 -0
- package/dist/skill_loop.js +58 -0
- package/dist/store.d.ts +31 -0
- package/dist/store.js +213 -0
- package/dist/sync.d.ts +3 -0
- package/dist/sync.js +135 -0
- package/dist/task.d.ts +7 -0
- package/dist/task.js +44 -0
- package/dist/transition.d.ts +34 -0
- package/dist/transition.js +400 -0
- package/dist/types.d.ts +138 -0
- package/dist/types.js +3 -0
- package/package.json +8 -53
- package/templates/workflow/skills/superspec-apply/SKILL.md +46 -118
- package/templates/workflow/skills/superspec-archive/SKILL.md +22 -47
- package/templates/workflow/skills/superspec-explore/SKILL.md +38 -69
- package/templates/workflow/skills/superspec-propose/SKILL.md +58 -57
- package/templates/workflow/skills/superspec-review/SKILL.md +36 -81
- package/adapters/codex/agents/architect.toml +0 -13
- package/adapters/codex/agents/code-reviewer.toml +0 -13
- package/adapters/codex/agents/critic.toml +0 -13
- package/adapters/codex/agents/executor.toml +0 -13
- package/adapters/codex/agents/explore.toml +0 -13
- package/adapters/codex/agents/test-engineer.toml +0 -13
- package/adapters/codex/agents/test-runner.toml +0 -13
- package/adapters/codex/agents/verifier.toml +0 -13
- package/adapters/codex/install-map.json +0 -116
- package/bin/launch.js +0 -37
- package/bin/superspec-check.js +0 -4
- package/bin/superspec-hook.js +0 -4
- package/bin/superspec-init.js +0 -4
- package/bin/superspec.js +0 -4
- package/dist/src/apply_worker_chain.d.ts +0 -60
- package/dist/src/apply_worker_chain.js +0 -1283
- package/dist/src/apply_worker_chain_lifecycle.d.ts +0 -21
- package/dist/src/apply_worker_chain_lifecycle.js +0 -409
- package/dist/src/archive.d.ts +0 -23
- package/dist/src/archive.js +0 -430
- package/dist/src/cli.d.ts +0 -1
- package/dist/src/cli.js +0 -33
- package/dist/src/cli_args.d.ts +0 -32
- package/dist/src/cli_args.js +0 -454
- package/dist/src/core.d.ts +0 -20
- package/dist/src/core.js +0 -394
- package/dist/src/disclosure.d.ts +0 -35
- package/dist/src/disclosure.js +0 -671
- package/dist/src/doctor.d.ts +0 -44
- package/dist/src/doctor.js +0 -230
- package/dist/src/evidence.d.ts +0 -29
- package/dist/src/evidence.js +0 -1107
- package/dist/src/gates.d.ts +0 -19
- package/dist/src/gates.js +0 -1631
- package/dist/src/git.d.ts +0 -8
- package/dist/src/git.js +0 -112
- package/dist/src/hooks/adapter.d.ts +0 -5
- package/dist/src/hooks/adapter.js +0 -347
- package/dist/src/hooks/guard_api.d.ts +0 -12
- package/dist/src/hooks/guard_api.js +0 -797
- package/dist/src/hooks/health.d.ts +0 -4
- package/dist/src/hooks/health.js +0 -86
- package/dist/src/hooks/policy_event.d.ts +0 -41
- package/dist/src/hooks/policy_event.js +0 -2634
- package/dist/src/hooks/types.d.ts +0 -72
- package/dist/src/hooks/types.js +0 -1
- package/dist/src/hooks/validation.d.ts +0 -3
- package/dist/src/hooks/validation.js +0 -70
- package/dist/src/i18n.d.ts +0 -21
- package/dist/src/i18n.js +0 -720
- package/dist/src/init_cli.d.ts +0 -28
- package/dist/src/init_cli.js +0 -399
- package/dist/src/install_engine.d.ts +0 -71
- package/dist/src/install_engine.js +0 -538
- package/dist/src/invariants.d.ts +0 -16
- package/dist/src/invariants.js +0 -363
- package/dist/src/openspec.d.ts +0 -37
- package/dist/src/openspec.js +0 -274
- package/dist/src/packet_render.d.ts +0 -5
- package/dist/src/packet_render.js +0 -1759
- package/dist/src/packet_schema.d.ts +0 -58
- package/dist/src/packet_schema.js +0 -1
- package/dist/src/paths.d.ts +0 -22
- package/dist/src/paths.js +0 -203
- package/dist/src/project_init.d.ts +0 -31
- package/dist/src/project_init.js +0 -167
- package/dist/src/self_update.d.ts +0 -14
- package/dist/src/self_update.js +0 -56
- package/dist/src/state.d.ts +0 -37
- package/dist/src/state.js +0 -464
- package/dist/src/tasks.d.ts +0 -38
- package/dist/src/tasks.js +0 -373
- package/dist/src/util.d.ts +0 -163
- package/dist/src/util.js +0 -792
- package/dist/superspec.d.ts +0 -6
- package/dist/superspec.js +0 -97
- package/dist/superspec_guard.d.ts +0 -4
- package/dist/superspec_guard.js +0 -19
- package/dist/superspec_hook.d.ts +0 -4
- package/dist/superspec_hook.js +0 -35
- package/dist/superspec_init.d.ts +0 -2
- package/dist/superspec_init.js +0 -17
- package/schemas/hook-event.schema.json +0 -27
- package/schemas/install-manifest.schema.json +0 -97
- package/templates/hooks/codex-hooks.json +0 -35
- package/templates/sidecar/archive-preservation.json +0 -11
- package/templates/sidecar/business-invariants.md +0 -38
- package/templates/sidecar/config.yaml +0 -13
- package/templates/sidecar/discovery.md +0 -33
- package/templates/sidecar/test-contract.md +0 -27
- package/templates/workflow/prompts/architect.md +0 -27
- package/templates/workflow/prompts/code-reviewer.md +0 -34
- package/templates/workflow/prompts/critic.md +0 -30
- package/templates/workflow/prompts/executor.md +0 -32
- package/templates/workflow/prompts/explore.md +0 -27
- package/templates/workflow/prompts/test-engineer.md +0 -28
- package/templates/workflow/prompts/test-runner.md +0 -35
- package/templates/workflow/prompts/verifier.md +0 -35
package/dist/superspec.d.ts
DELETED
package/dist/superspec.js
DELETED
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { realpathSync } from "node:fs";
|
|
3
|
-
import { resolve } from "node:path";
|
|
4
|
-
export * from "./src/init_cli.js";
|
|
5
|
-
export * from "./src/cli.js";
|
|
6
|
-
export * from "./src/doctor.js";
|
|
7
|
-
export * from "./src/self_update.js";
|
|
8
|
-
import { main } from "./src/cli.js";
|
|
9
|
-
import { main_doctor, superspec_package_version } from "./src/doctor.js";
|
|
10
|
-
import { main_init_async } from "./src/init_cli.js";
|
|
11
|
-
import { update_self_then_rerun } from "./src/self_update.js";
|
|
12
|
-
function realpathMaybe(filePath) {
|
|
13
|
-
try {
|
|
14
|
-
return realpathSync(filePath);
|
|
15
|
-
}
|
|
16
|
-
catch {
|
|
17
|
-
return resolve(filePath);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
function help() {
|
|
21
|
-
return [
|
|
22
|
-
"usage: superspec <command> [options]",
|
|
23
|
-
"",
|
|
24
|
-
"commands:",
|
|
25
|
-
" init install SuperSpec Codex surfaces (asks project/user; default project)",
|
|
26
|
-
" update update SuperSpec CLI, then update manifest-managed surfaces",
|
|
27
|
-
" uninstall remove manifest-managed SuperSpec surfaces",
|
|
28
|
-
" check run the SuperSpec check command surface",
|
|
29
|
-
" doctor diagnose SuperSpec/OpenSpec/npm/PATH wiring",
|
|
30
|
-
" version print SuperSpec CLI version",
|
|
31
|
-
"",
|
|
32
|
-
"examples:",
|
|
33
|
-
" superspec init --scope project",
|
|
34
|
-
" superspec init --scope user",
|
|
35
|
-
" superspec check check-init --change <change> --format agent",
|
|
36
|
-
" superspec doctor",
|
|
37
|
-
"",
|
|
38
|
-
].join("\n");
|
|
39
|
-
}
|
|
40
|
-
function updateHelp() {
|
|
41
|
-
return [
|
|
42
|
-
"usage: superspec update [--scope {project,user}] [--path PATH] [--codex-home PATH] [--format {json,agent,user}] [--local-only]",
|
|
43
|
-
"",
|
|
44
|
-
"updates the global SuperSpec CLI from npm, then updates manifest-managed SuperSpec surfaces.",
|
|
45
|
-
"",
|
|
46
|
-
"options:",
|
|
47
|
-
" --scope {project,user} update project .codex surfaces or user Codex home surfaces (default: project)",
|
|
48
|
-
" --project equivalent to --scope project",
|
|
49
|
-
" --user, --global equivalent to --scope user",
|
|
50
|
-
" --path PATH project root for project scope (default: current directory)",
|
|
51
|
-
" --codex-home PATH Codex user home for user scope (default: $CODEX_HOME or ~/.codex)",
|
|
52
|
-
" --format {json,agent,user} output format (default: user); use json for diagnostics/automation",
|
|
53
|
-
" --local-only skip npm self-update and use the currently installed package",
|
|
54
|
-
" -h, --help show this help",
|
|
55
|
-
"",
|
|
56
|
-
].join("\n");
|
|
57
|
-
}
|
|
58
|
-
export async function main_superspec(argv = process.argv.slice(2)) {
|
|
59
|
-
const [command, ...rest] = argv;
|
|
60
|
-
if (command === undefined || command === "-h" || command === "--help") {
|
|
61
|
-
process.stdout.write(help());
|
|
62
|
-
return 0;
|
|
63
|
-
}
|
|
64
|
-
if (command === "-v" || command === "--version" || command === "version") {
|
|
65
|
-
process.stdout.write(`${superspec_package_version()}\n`);
|
|
66
|
-
return 0;
|
|
67
|
-
}
|
|
68
|
-
if (command === "init")
|
|
69
|
-
return main_init_async(rest);
|
|
70
|
-
if (command === "update") {
|
|
71
|
-
if (rest.includes("-h") || rest.includes("--help")) {
|
|
72
|
-
process.stdout.write(updateHelp());
|
|
73
|
-
return 0;
|
|
74
|
-
}
|
|
75
|
-
const localOnly = rest.includes("--local-only") || rest.includes("--skip-self-update");
|
|
76
|
-
const updateArgs = rest.filter((arg) => arg !== "--local-only" && arg !== "--skip-self-update");
|
|
77
|
-
if (!localOnly)
|
|
78
|
-
return update_self_then_rerun({ args: updateArgs });
|
|
79
|
-
return main_init_async([...updateArgs, "--update"]);
|
|
80
|
-
}
|
|
81
|
-
if (command === "uninstall")
|
|
82
|
-
return main_init_async([...rest, "--uninstall"]);
|
|
83
|
-
if (command === "check" || command === "guard")
|
|
84
|
-
return main(rest);
|
|
85
|
-
if (command === "doctor")
|
|
86
|
-
return main_doctor(rest);
|
|
87
|
-
// Convenience fallback: `superspec check-init ...` behaves like `superspec check check-init ...`.
|
|
88
|
-
if (command.startsWith("check-") || command === "status" || command === "recompute" || command === "init") {
|
|
89
|
-
return main(argv);
|
|
90
|
-
}
|
|
91
|
-
process.stderr.write(`superspec: unknown command ${JSON.stringify(command)}\n\n${help()}`);
|
|
92
|
-
return 2;
|
|
93
|
-
}
|
|
94
|
-
const currentFile = realpathMaybe(process.argv[1] ?? "");
|
|
95
|
-
if (currentFile === realpathMaybe(new URL(import.meta.url).pathname)) {
|
|
96
|
-
process.exitCode = await main_superspec();
|
|
97
|
-
}
|
package/dist/superspec_guard.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { realpathSync } from "node:fs";
|
|
3
|
-
import { resolve } from "node:path";
|
|
4
|
-
export * from "./src/core.js";
|
|
5
|
-
export * from "./src/cli.js";
|
|
6
|
-
export * from "./src/cli_args.js";
|
|
7
|
-
import { main } from "./src/cli.js";
|
|
8
|
-
function realpathMaybe(filePath) {
|
|
9
|
-
try {
|
|
10
|
-
return realpathSync(filePath);
|
|
11
|
-
}
|
|
12
|
-
catch {
|
|
13
|
-
return resolve(filePath);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
const currentFile = realpathMaybe(process.argv[1] ?? "");
|
|
17
|
-
if (currentFile === realpathMaybe(new URL(import.meta.url).pathname)) {
|
|
18
|
-
process.exitCode = main();
|
|
19
|
-
}
|
package/dist/superspec_hook.d.ts
DELETED
package/dist/superspec_hook.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import "./src/core.js";
|
|
3
|
-
export * from "./src/hooks/adapter.js";
|
|
4
|
-
import { readFileSync, realpathSync } from "node:fs";
|
|
5
|
-
import { resolve } from "node:path";
|
|
6
|
-
import { runHookAdapter } from "./src/hooks/adapter.js";
|
|
7
|
-
function realpathMaybe(filePath) {
|
|
8
|
-
try {
|
|
9
|
-
return realpathSync(filePath);
|
|
10
|
-
}
|
|
11
|
-
catch {
|
|
12
|
-
return resolve(filePath);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
const currentFile = realpathMaybe(process.argv[1] ?? "");
|
|
16
|
-
export function main_hook(argv = process.argv.slice(2)) {
|
|
17
|
-
const stdin = readStdin();
|
|
18
|
-
const result = runHookAdapter(argv, stdin);
|
|
19
|
-
if (result.stdout)
|
|
20
|
-
process.stdout.write(result.stdout);
|
|
21
|
-
if (result.stderr)
|
|
22
|
-
process.stderr.write(result.stderr);
|
|
23
|
-
return result.code;
|
|
24
|
-
}
|
|
25
|
-
function readStdin() {
|
|
26
|
-
try {
|
|
27
|
-
return readFileSync(0, "utf8");
|
|
28
|
-
}
|
|
29
|
-
catch {
|
|
30
|
-
return "";
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
if (currentFile === realpathMaybe(new URL(import.meta.url).pathname)) {
|
|
34
|
-
process.exitCode = main_hook();
|
|
35
|
-
}
|
package/dist/superspec_init.d.ts
DELETED
package/dist/superspec_init.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { realpathSync } from "node:fs";
|
|
3
|
-
import { resolve } from "node:path";
|
|
4
|
-
export * from "./src/init_cli.js";
|
|
5
|
-
import { main_init_async } from "./src/init_cli.js";
|
|
6
|
-
function realpathMaybe(filePath) {
|
|
7
|
-
try {
|
|
8
|
-
return realpathSync(filePath);
|
|
9
|
-
}
|
|
10
|
-
catch {
|
|
11
|
-
return resolve(filePath);
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
const currentFile = realpathMaybe(process.argv[1] ?? "");
|
|
15
|
-
if (currentFile === realpathMaybe(new URL(import.meta.url).pathname)) {
|
|
16
|
-
process.exitCode = await main_init_async();
|
|
17
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"$id": "https://superspec.local/schemas/hook-event.schema.json",
|
|
4
|
-
"title": "SuperSpec Codex Hook Event",
|
|
5
|
-
"type": "object",
|
|
6
|
-
"required": ["hook_event_name", "cwd"],
|
|
7
|
-
"properties": {
|
|
8
|
-
"session_id": { "type": "string" },
|
|
9
|
-
"turn_id": { "type": "string" },
|
|
10
|
-
"transcript_path": { "type": ["string", "null"] },
|
|
11
|
-
"cwd": { "type": "string" },
|
|
12
|
-
"hook_event_name": {
|
|
13
|
-
"type": "string",
|
|
14
|
-
"enum": ["PreToolUse", "PostToolUse", "SubagentStart", "SubagentStop"]
|
|
15
|
-
},
|
|
16
|
-
"permission_mode": { "type": "string" },
|
|
17
|
-
"tool_name": { "type": "string" },
|
|
18
|
-
"tool_use_id": { "type": "string" },
|
|
19
|
-
"tool_input": { "type": "object" },
|
|
20
|
-
"tool_response": { "type": ["object", "array", "string", "number", "boolean", "null"] },
|
|
21
|
-
"agent_id": { "type": "string" },
|
|
22
|
-
"agent_type": { "type": "string" },
|
|
23
|
-
"agent_transcript_path": { "type": ["string", "null"] },
|
|
24
|
-
"last_assistant_message": { "type": ["string", "null"] }
|
|
25
|
-
},
|
|
26
|
-
"additionalProperties": true
|
|
27
|
-
}
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"$id": "https://irenshi.local/superspec/install-manifest.schema.json",
|
|
4
|
-
"title": "SuperSpec install manifest",
|
|
5
|
-
"type": "object",
|
|
6
|
-
"additionalProperties": false,
|
|
7
|
-
"required": [
|
|
8
|
-
"superspecVersion",
|
|
9
|
-
"installedAt",
|
|
10
|
-
"guardSchemaVersion",
|
|
11
|
-
"guardWiring",
|
|
12
|
-
"files",
|
|
13
|
-
"createdDirs",
|
|
14
|
-
"dataGlobs"
|
|
15
|
-
],
|
|
16
|
-
"properties": {
|
|
17
|
-
"superspecVersion": {
|
|
18
|
-
"type": "string",
|
|
19
|
-
"minLength": 1
|
|
20
|
-
},
|
|
21
|
-
"packageSpec": {
|
|
22
|
-
"type": "string",
|
|
23
|
-
"minLength": 1
|
|
24
|
-
},
|
|
25
|
-
"installedAt": {
|
|
26
|
-
"type": "string",
|
|
27
|
-
"format": "date-time"
|
|
28
|
-
},
|
|
29
|
-
"guardSchemaVersion": {
|
|
30
|
-
"type": "integer",
|
|
31
|
-
"minimum": 1
|
|
32
|
-
},
|
|
33
|
-
"guardWiring": {
|
|
34
|
-
"type": "string",
|
|
35
|
-
"enum": ["global-bin", "npm-bin", "repo-wrapper"]
|
|
36
|
-
},
|
|
37
|
-
"installScope": {
|
|
38
|
-
"type": "string",
|
|
39
|
-
"enum": ["project", "user"]
|
|
40
|
-
},
|
|
41
|
-
"files": {
|
|
42
|
-
"type": "array",
|
|
43
|
-
"items": {
|
|
44
|
-
"type": "object",
|
|
45
|
-
"additionalProperties": false,
|
|
46
|
-
"required": ["path", "sha256", "managed", "preexisting"],
|
|
47
|
-
"properties": {
|
|
48
|
-
"path": {
|
|
49
|
-
"type": "string",
|
|
50
|
-
"minLength": 1
|
|
51
|
-
},
|
|
52
|
-
"sha256": {
|
|
53
|
-
"type": "string",
|
|
54
|
-
"pattern": "^sha256:[0-9a-f]{64}$"
|
|
55
|
-
},
|
|
56
|
-
"managed": {
|
|
57
|
-
"type": "boolean"
|
|
58
|
-
},
|
|
59
|
-
"preexisting": {
|
|
60
|
-
"type": "boolean"
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
"createdDirs": {
|
|
66
|
-
"type": "array",
|
|
67
|
-
"items": {
|
|
68
|
-
"type": "string",
|
|
69
|
-
"minLength": 1
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
"dataGlobs": {
|
|
73
|
-
"type": "array",
|
|
74
|
-
"items": {
|
|
75
|
-
"type": "string",
|
|
76
|
-
"minLength": 1
|
|
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
|
-
}
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"superspec": {
|
|
3
|
-
"managed": true,
|
|
4
|
-
"adapter_version": "superspec-hook@2",
|
|
5
|
-
"strict_profile_default": "audit-only-until-r1-provenance-passes"
|
|
6
|
-
},
|
|
7
|
-
"hooks": {
|
|
8
|
-
"SubagentStart": [
|
|
9
|
-
{
|
|
10
|
-
"matcher": ".*",
|
|
11
|
-
"hooks": [
|
|
12
|
-
{
|
|
13
|
-
"type": "command",
|
|
14
|
-
"command": "superspec-hook --change \"$SUPERSPEC_CHANGE\"",
|
|
15
|
-
"timeout": 120,
|
|
16
|
-
"statusMessage": "SuperSpec 子智能体启动记录"
|
|
17
|
-
}
|
|
18
|
-
]
|
|
19
|
-
}
|
|
20
|
-
],
|
|
21
|
-
"SubagentStop": [
|
|
22
|
-
{
|
|
23
|
-
"matcher": ".*",
|
|
24
|
-
"hooks": [
|
|
25
|
-
{
|
|
26
|
-
"type": "command",
|
|
27
|
-
"command": "superspec-hook --change \"$SUPERSPEC_CHANGE\"",
|
|
28
|
-
"timeout": 120,
|
|
29
|
-
"statusMessage": "SuperSpec 子智能体停止记录"
|
|
30
|
-
}
|
|
31
|
-
]
|
|
32
|
-
}
|
|
33
|
-
]
|
|
34
|
-
}
|
|
35
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
<!-- SuperSpec sidecar: write to openspec/changes/<change>/.superspec/artifacts/business-invariants.md
|
|
2
|
-
This is not an OpenSpec artifact and must not enter the OpenSpec graph. -->
|
|
3
|
-
|
|
4
|
-
# 业务不变量
|
|
5
|
-
|
|
6
|
-
## Source Anchor Policy
|
|
7
|
-
|
|
8
|
-
- 每条 `INV-*` 必须有 `source_anchors`。
|
|
9
|
-
- `confirmed` / `source-backed` 可进入 test-contract 硬映射。
|
|
10
|
-
- `inferred` 只能进入 review checklist,除非补充 human confirmation。
|
|
11
|
-
- 实现开始后新增或重写不变量,必须标记 `created_after_implementation: true` 并重新触发相关 gate。
|
|
12
|
-
- `test-contract.md` 只映射 `INV-*`,不重复承载完整不变量正文。
|
|
13
|
-
|
|
14
|
-
## Invariants
|
|
15
|
-
|
|
16
|
-
| INV-ID | statement | scope | source_anchors | acceptance_refs | risk_refs | confidence | enforcement_level | test_refs_or_review_only_reason | verification | risk_if_broken | invalidation_triggers | created_after_implementation |
|
|
17
|
-
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
18
|
-
| INV-001 | | | | REQ-001 | RISK-001 | source-backed | automated-test | TEST-001 | automated-test | | | false |
|
|
19
|
-
|
|
20
|
-
## Non-invariants / Rejected Candidates
|
|
21
|
-
|
|
22
|
-
| candidate | reason_rejected | reviewer |
|
|
23
|
-
|---|---|---|
|
|
24
|
-
| | | |
|
|
25
|
-
|
|
26
|
-
## Mapping
|
|
27
|
-
|
|
28
|
-
| INV-ID | REQ/Scenario refs | risk refs | TEST refs | REVIEW refs | task refs |
|
|
29
|
-
|---|---|---|---|---|---|
|
|
30
|
-
| INV-001 | REQ-001 | RISK-001 | TEST-001 | | TASK-001 |
|
|
31
|
-
|
|
32
|
-
## Review Notes
|
|
33
|
-
|
|
34
|
-
```yaml
|
|
35
|
-
business_invariants_verified: []
|
|
36
|
-
broken_or_weak_invariants: []
|
|
37
|
-
human_confirmations_required: []
|
|
38
|
-
```
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
# superspec config.yaml template
|
|
2
|
-
# Project path: .superspec/config.yaml
|
|
3
|
-
# Change path: openspec/changes/<change>/.superspec/config.yaml
|
|
4
|
-
|
|
5
|
-
preset: full
|
|
6
|
-
commands:
|
|
7
|
-
validate: openspec validate <change>
|
|
8
|
-
test: ""
|
|
9
|
-
roles: {}
|
|
10
|
-
rules: {}
|
|
11
|
-
trust:
|
|
12
|
-
v1_evidence: audit-only
|
|
13
|
-
archive: {}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
<!-- SuperSpec sidecar:写入 openspec/changes/<change>/.superspec/artifacts/discovery.md -->
|
|
2
|
-
|
|
3
|
-
## 调查范围
|
|
4
|
-
|
|
5
|
-
- change: `<change>`
|
|
6
|
-
- repo refs:
|
|
7
|
-
- source anchors:
|
|
8
|
-
|
|
9
|
-
## 现有实现事实
|
|
10
|
-
|
|
11
|
-
-
|
|
12
|
-
|
|
13
|
-
## 隐性合约
|
|
14
|
-
|
|
15
|
-
-
|
|
16
|
-
|
|
17
|
-
## 风险与歧义
|
|
18
|
-
|
|
19
|
-
-
|
|
20
|
-
|
|
21
|
-
## 待确认问题
|
|
22
|
-
|
|
23
|
-
<!-- 需要用户拍板的问题逐条列在此处:未决用 "- [ ]",已确认用 "- [x]"。
|
|
24
|
-
explore_complete 检查在所有项变成 "- [x]"(或标注「已确认」)之前不会通过,也不会进入 propose。
|
|
25
|
-
段标题包含「确认」字样即可被识别(待确认 / 需要用户确认 等)。 -->
|
|
26
|
-
|
|
27
|
-
- [ ] <待确认问题 1>
|
|
28
|
-
- [ ] <待确认问题 2>
|
|
29
|
-
|
|
30
|
-
## Subagent Evidence
|
|
31
|
-
|
|
32
|
-
- explore:
|
|
33
|
-
- critic:
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
<!-- SuperSpec sidecar:写入 openspec/changes/<change>/.superspec/artifacts/test-contract.md
|
|
2
|
-
不是 OpenSpec artifact,不进 openspec status graph。 -->
|
|
3
|
-
|
|
4
|
-
## 测试覆盖矩阵
|
|
5
|
-
|
|
6
|
-
| TEST-ID | 关联 REQ/Scenario | 关联 INV | 维度 | 测试意图(断言什么行为) | 预期 RED 原因 |
|
|
7
|
-
|---|---|---|---|---|---|
|
|
8
|
-
| TEST-001 | <REQ-xxx / Scenario 名> | INV-xxx | 正常路径 | | |
|
|
9
|
-
|
|
10
|
-
## 红绿灯契约
|
|
11
|
-
|
|
12
|
-
### TEST-001
|
|
13
|
-
- `invariant_refs`: INV-xxx
|
|
14
|
-
- `expected_red`: <实现前因何失败>
|
|
15
|
-
- `expected_green`: <实现后通过的判据>
|
|
16
|
-
- `test_command`: <framework-agnostic command that runs exactly the target test identity>
|
|
17
|
-
|
|
18
|
-
## Iron Law
|
|
19
|
-
|
|
20
|
-
- 没有正在失败的测试,不准写实现代码。
|
|
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`。
|
|
23
|
-
|
|
24
|
-
## 与 tasks 的映射约定
|
|
25
|
-
|
|
26
|
-
<!-- 每个 TEST-ID 必须在 tasks.md 至少一个 task 的 test_refs 中出现;guard 交叉校验。 -->
|
|
27
|
-
<!-- 每个 hard INV-ID 必须在 test-contract.md 至少一个 TEST-ID 的 关联 INV 中出现,并在 tasks.md 至少一个 task 的 invariant_refs 中出现。 -->
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: "架构与边界审查角色"
|
|
3
|
-
argument-hint: "任务说明或 review-packet prompt_ref"
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Architect
|
|
7
|
-
|
|
8
|
-
## 角色身份
|
|
9
|
-
|
|
10
|
-
你是 Architect。你审查系统边界、接口契约、数据流、长期维护风险、回滚难度和设计取舍。你提供架构 guidance,不替代主流程做最终判断。
|
|
11
|
-
|
|
12
|
-
## 读写边界
|
|
13
|
-
|
|
14
|
-
- 默认只读;不要修改文件。
|
|
15
|
-
- 不评价没有打开或没有被 packet/source refs 指向的材料。
|
|
16
|
-
- 如果需要扩大审查范围,向主流程说明缺口,不要自行改派或改代码。
|
|
17
|
-
|
|
18
|
-
## SuperSpec Packet 规则
|
|
19
|
-
|
|
20
|
-
在 `superspec-review` 或 disclosure review 中,先读取主流程提供的 `review-packet` 或 `prompt_ref`。以 packet 中的 `target_refs`、`source_refs`、`required_output_kind`、`output_contract_fields`、`required_review_scope` 和 `stop_conditions` 为准;不要依赖本 prompt 记忆输出 schema。
|
|
21
|
-
|
|
22
|
-
## 输出风格
|
|
23
|
-
|
|
24
|
-
- 所有用户可见输出必须使用简体中文。
|
|
25
|
-
- 命令、路径、JSON/schema 字段、gate 名称、任务/测试 id、代码标识符保留原文。
|
|
26
|
-
- 结论先行,按严重度列出问题,给出文件/行号证据。
|
|
27
|
-
- 无阻塞问题时明确写“无阻塞问题”,并列残余风险或未验证项。
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: "代码质量、安全和规格符合性审查角色"
|
|
3
|
-
argument-hint: "任务说明、review-packet 或 apply-code-review-packet prompt_ref"
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Code Reviewer
|
|
7
|
-
|
|
8
|
-
## 角色身份
|
|
9
|
-
|
|
10
|
-
你是 Code Reviewer。你审查规格符合性、正确性、安全性、测试充分性、代码质量、性能和可维护性。你提供 source-backed guidance,不直接实现修复,也不替代主流程最终判断。
|
|
11
|
-
|
|
12
|
-
## 读写边界
|
|
13
|
-
|
|
14
|
-
- 只读;不要修改文件。
|
|
15
|
-
- 先看 diff、相关 specs/tasks/test contract,再判断实现是否满足请求。
|
|
16
|
-
- 不要只做风格审查;CRITICAL/HIGH 问题必须作为阻塞发现。
|
|
17
|
-
- 如果缺少必要上下文,报告缺口和需要主流程加载的 source,而不是猜测。
|
|
18
|
-
|
|
19
|
-
## SuperSpec Packet 规则
|
|
20
|
-
|
|
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
|
-
|
|
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 report 字段以提示包的 `code_review_report_required_fields` 为准;不要凭本 prompt 记忆或发明字段名。
|
|
26
|
-
|
|
27
|
-
遵守 `common_worker_report_policy`:长日志、完整 diff、编译输出和大段生成内容必须作为 artifact refs 返回,不要内联或截断。
|
|
28
|
-
|
|
29
|
-
## 输出风格
|
|
30
|
-
|
|
31
|
-
- 所有用户可见输出必须使用简体中文。
|
|
32
|
-
- 命令、路径、JSON/schema 字段、gate 名称、任务/测试 id、严重级别、代码标识符保留原文。
|
|
33
|
-
- Findings 先行,按 CRITICAL/HIGH/MEDIUM/LOW 排序,附具体文件/行号和修复建议。
|
|
34
|
-
- 无阻塞问题时明确写“无阻塞问题”,并列残余风险或测试缺口。
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: "反方审查与隐藏风险识别角色"
|
|
3
|
-
argument-hint: "任务说明或 review-packet prompt_ref"
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Critic
|
|
7
|
-
|
|
8
|
-
## 角色身份
|
|
9
|
-
|
|
10
|
-
你是 Critic。你用证据挑战计划、设计、实现和验证结论,重点找隐藏假设、范围漂移、验收漏洞、业务语义风险和证据跳读。你提供 guidance,不替代主流程最终判断。
|
|
11
|
-
|
|
12
|
-
## 读写边界
|
|
13
|
-
|
|
14
|
-
- 默认只读;不要修改文件。
|
|
15
|
-
- 必须打开被引用文件或 packet 指向的 refs 后再判断。
|
|
16
|
-
- 不要编造问题;没有阻塞问题时明确通过。
|
|
17
|
-
- 如果发现需要更宽上下文,向主流程说明需要加载的 source 或 claim。
|
|
18
|
-
|
|
19
|
-
## SuperSpec Packet 规则
|
|
20
|
-
|
|
21
|
-
在 `superspec-review` 或 disclosure review 中,先读取主流程提供的 `review-packet` 或 `prompt_ref`。以 packet 中的 `target_refs`、`source_refs`、`required_output_kind`、`output_contract_fields`、`required_review_scope` 和 `stop_conditions` 为准;不要依赖本 prompt 记忆输出 schema。
|
|
22
|
-
|
|
23
|
-
当你在 `review_complete` 中承担 verification lane 时,必须确认 packet 的 `required_output_kind` 是 `verification_review`;否则只输出 source guidance。
|
|
24
|
-
|
|
25
|
-
## 输出风格
|
|
26
|
-
|
|
27
|
-
- 所有用户可见输出必须使用简体中文。
|
|
28
|
-
- 命令、路径、JSON/schema 字段、gate 名称、任务/测试 id、代码标识符保留原文。
|
|
29
|
-
- 结论先行:通过或驳回;驳回时列最关键的阻塞问题和证据。
|
|
30
|
-
- 区分确定缺陷、证据不足和残余风险。
|
|
@@ -1,32 +0,0 @@
|
|
|
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
|
-
- 报告字段以提示包的 `executor_report_required_fields` 为准;不要凭本 prompt 记忆或发明字段名。
|
|
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 返回,不要内联或截断。
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: "仓库代码事实扫描与 discovery 覆盖辅助角色"
|
|
3
|
-
argument-hint: "任务说明、workflow-packet 或 prompt_ref"
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Explore
|
|
7
|
-
|
|
8
|
-
## 角色身份
|
|
9
|
-
|
|
10
|
-
你是 Explore。你负责 repo-local 只读事实扫描:定位实现入口、源码锚点、隐性合约、相邻风险和 discovery 可能遗漏的事实。你不批准范围,不写正式证据,也不替代主流程决策。
|
|
11
|
-
|
|
12
|
-
## 读写边界
|
|
13
|
-
|
|
14
|
-
- 默认只读;不要修改文件。
|
|
15
|
-
- 优先使用 repo search 和文件读取验证事实,结论必须绑定可读源码或文档锚点。
|
|
16
|
-
- 不要写 `proposal.md`/`design.md`/`tasks.md`/`specs/**`/`.superspec/**`。
|
|
17
|
-
- 不能作为 `explore_complete` 的 role evidence;需要门禁审查时交给 `critic`。
|
|
18
|
-
|
|
19
|
-
## SuperSpec Packet 规则
|
|
20
|
-
|
|
21
|
-
如果主流程提供 `workflow-packet` 或 `prompt_ref`,先读取 packet 指向的 refs。以 packet 中的 `target_refs`、`source_refs`、`required_load_refs`、`artifact_refs` 和 `stop_conditions` 为准;不要依赖本 prompt 记忆输出 schema。
|
|
22
|
-
|
|
23
|
-
## 输出风格
|
|
24
|
-
|
|
25
|
-
- 所有用户可见输出必须使用简体中文。
|
|
26
|
-
- 命令、路径、JSON/schema 字段、gate 名称、任务/测试 id、代码标识符保留原文。
|
|
27
|
-
- 结论先行;列出最相关文件/行号、已确认事实、仍缺的来源或需要主流程确认的问题。
|