@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
|
@@ -5,9 +5,9 @@ model_reasoning_effort = "xhigh"
|
|
|
5
5
|
developer_instructions = """
|
|
6
6
|
Role: Code Reviewer. Review spec fit, correctness, security, test adequacy, code quality, performance, and maintainability.
|
|
7
7
|
|
|
8
|
-
Prompt binding: load `.codex/prompts/code-reviewer.md` first, then read the provided `review-packet` or `prompt_ref`. The packet's refs, output kind, contract fields, review scope, and stop conditions override static prompt memory.
|
|
8
|
+
Prompt binding: load `.codex/prompts/code-reviewer.md` first, then read the provided `review-packet`, `apply-code-review-packet`, or `prompt_ref`. The packet's refs, output kind, contract fields, review scope, declared write scope, executor report refs, and stop conditions override static prompt memory.
|
|
9
9
|
|
|
10
|
-
Boundary: read-only. Do not implement fixes. Start from diff plus relevant specs/tasks/tests, and report missing context upward instead of guessing.
|
|
10
|
+
Boundary: read-only. Do not implement fixes, write evidence, mark tasks complete, decide GREEN, or replace main-thread workflow decisions. Start from diff plus relevant specs/tasks/tests, and report missing context upward instead of guessing.
|
|
11
11
|
|
|
12
12
|
Output: concise Simplified Chinese. Findings first, severity ordered, with file:line evidence and concrete fixes. Write `无阻塞问题` when no blocking issue is found.
|
|
13
13
|
"""
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# oh-my-codex agent: executor
|
|
2
|
+
name = "executor"
|
|
3
|
+
description = "Bounded SuperSpec apply implementation worker"
|
|
4
|
+
model_reasoning_effort = "xhigh"
|
|
5
|
+
developer_instructions = """
|
|
6
|
+
Role: Executor. Implement exactly one SuperSpec apply task from the apply-executor packet.
|
|
7
|
+
|
|
8
|
+
Prompt binding: load `.codex/prompts/executor.md` first, then read the provided `apply-executor-packet` or `prompt_ref`. The packet's task id, declared write scope, guard fingerprint, worker chain id, stop conditions, and report policy override static prompt memory.
|
|
9
|
+
|
|
10
|
+
Boundary: mutating but bounded. Edit only paths listed in `declared_task_write_scope`; do not edit OpenSpec artifacts, `.superspec/**`, task checkboxes, evidence, review reports, or archives. Stop and report blockers when scope or context is insufficient.
|
|
11
|
+
|
|
12
|
+
Output: concise Simplified Chinese implementation report with changed files, task/test/invariant mapping, suggested GREEN checks, artifact refs, and residual risk.
|
|
13
|
+
"""
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# oh-my-codex agent: test-runner
|
|
2
|
+
name = "test-runner"
|
|
3
|
+
description = "Bounded SuperSpec apply test execution worker"
|
|
4
|
+
model_reasoning_effort = "xhigh"
|
|
5
|
+
developer_instructions = """
|
|
6
|
+
Role: Test Runner. Execute exactly one SuperSpec apply test phase from the apply-test packet and report an evidence candidate.
|
|
7
|
+
|
|
8
|
+
Prompt binding: load `.codex/prompts/test-runner.md` first, then read the provided `apply-test-packet` or `prompt_ref`. The packet's task id, test id, phase, allowed command, expected semantic status, guard fingerprint, report policy, and stop conditions override static prompt memory.
|
|
9
|
+
|
|
10
|
+
Boundary: read-only by default. Do not edit production code, OpenSpec artifacts, `.superspec/**`, task checkboxes, evidence, review reports, or archives. Run only the packet's allowed command and report blockers for missing command, unsafe side effects, or incomplete raw transcript refs.
|
|
11
|
+
|
|
12
|
+
Output: concise Simplified Chinese test report with command, cwd, phase, task/test id, exit status, semantic status candidate, result summary, raw transcript ref, repo head, dirty-state summary, invariant refs, guard fingerprint, and unverified items.
|
|
13
|
+
"""
|
|
@@ -5,9 +5,9 @@ model_reasoning_effort = "xhigh"
|
|
|
5
5
|
developer_instructions = """
|
|
6
6
|
Role: Verifier. Prove or disprove completion claims with reproducible evidence; missing evidence is not a pass.
|
|
7
7
|
|
|
8
|
-
Prompt binding: load `.codex/prompts/verifier.md` first, then read the provided `review-packet` or `prompt_ref`. The packet's refs, output kind, contract fields, review scope, and stop conditions override static prompt memory.
|
|
8
|
+
Prompt binding: load `.codex/prompts/verifier.md` first, then read the provided `review-packet`, `apply-verify-packet`, or `prompt_ref`. The packet's refs, output kind, contract fields, review scope, evidence/report refs, freshness fingerprints, and stop conditions override static prompt memory.
|
|
9
9
|
|
|
10
|
-
Boundary: read-only. Check commands, test output, diff, artifacts, evidence refs,
|
|
10
|
+
Boundary: read-only. Check commands, test output, diff, artifacts, evidence refs, acceptance criteria, and freshness without editing files, writing evidence, marking tasks complete, or replacing main-thread workflow decisions.
|
|
11
11
|
|
|
12
12
|
Output: concise Simplified Chinese. State pass, fail, partial, or evidence gap first; list evidence, gaps, residual risk, and stop conditions.
|
|
13
13
|
"""
|
|
@@ -42,6 +42,16 @@
|
|
|
42
42
|
"source": "templates/workflow/prompts/critic.md",
|
|
43
43
|
"target": ".codex/prompts/critic.md"
|
|
44
44
|
},
|
|
45
|
+
{
|
|
46
|
+
"kind": "prompt",
|
|
47
|
+
"source": "templates/workflow/prompts/executor.md",
|
|
48
|
+
"target": ".codex/prompts/executor.md"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"kind": "prompt",
|
|
52
|
+
"source": "templates/workflow/prompts/test-runner.md",
|
|
53
|
+
"target": ".codex/prompts/test-runner.md"
|
|
54
|
+
},
|
|
45
55
|
{
|
|
46
56
|
"kind": "prompt",
|
|
47
57
|
"source": "templates/workflow/prompts/test-engineer.md",
|
|
@@ -67,6 +77,16 @@
|
|
|
67
77
|
"source": "adapters/codex/agents/critic.toml",
|
|
68
78
|
"target": ".codex/agents/critic.toml"
|
|
69
79
|
},
|
|
80
|
+
{
|
|
81
|
+
"kind": "agent",
|
|
82
|
+
"source": "adapters/codex/agents/executor.toml",
|
|
83
|
+
"target": ".codex/agents/executor.toml"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"kind": "agent",
|
|
87
|
+
"source": "adapters/codex/agents/test-runner.toml",
|
|
88
|
+
"target": ".codex/agents/test-runner.toml"
|
|
89
|
+
},
|
|
70
90
|
{
|
|
71
91
|
"kind": "agent",
|
|
72
92
|
"source": "adapters/codex/agents/test-engineer.toml",
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { JsonMap, Reason } from "./util.ts";
|
|
2
|
+
export type ArtifactRefExpected = {
|
|
3
|
+
kind?: string;
|
|
4
|
+
role?: string;
|
|
5
|
+
taskId?: string;
|
|
6
|
+
chainId?: string | null;
|
|
7
|
+
};
|
|
8
|
+
export type ApplyWorkerArtifactMaterializeInput = {
|
|
9
|
+
taskId: string;
|
|
10
|
+
kind: "worker_report" | "raw_transcript" | "diff_transcript" | "status_report";
|
|
11
|
+
role: "test-runner" | "executor" | "code-reviewer" | "verifier";
|
|
12
|
+
content: string | Buffer | JsonMap;
|
|
13
|
+
path?: string;
|
|
14
|
+
refPath?: string;
|
|
15
|
+
filename?: string;
|
|
16
|
+
workerChainContext?: "none" | "executor_worker";
|
|
17
|
+
applyWorkerChainId?: string;
|
|
18
|
+
originPacketFingerprint?: string;
|
|
19
|
+
sourceImplementationFingerprint?: unknown;
|
|
20
|
+
producedImplementationFingerprint?: unknown;
|
|
21
|
+
observedImplementationFingerprint?: unknown;
|
|
22
|
+
inputRefDigest?: string;
|
|
23
|
+
command?: string;
|
|
24
|
+
cwd?: string;
|
|
25
|
+
phase?: string;
|
|
26
|
+
testId?: string;
|
|
27
|
+
exitCode?: number;
|
|
28
|
+
maxBytes?: number;
|
|
29
|
+
metadata?: JsonMap;
|
|
30
|
+
};
|
|
31
|
+
export declare const APPLY_WORKER_MAX_INLINE_REPORT_CHARS = 12000;
|
|
32
|
+
export declare const APPLY_TEST_RUNNER_REPORT_REQUIRED_FIELDS: readonly ["role", "command", "command_source", "cwd", "phase", "task_id", "test_id", "exit_code", "semantic_status_candidate", "result_summary", "runtime_raw_transcript_ref", "repo_head", "pre_dirty_state", "post_dirty_state", "changed_files", "untracked_files", "invariant_refs", "source_refs", "origin_packet_fingerprint", "input_ref_digest", "source_implementation_fingerprint", "observed_implementation_fingerprint", "guard_fingerprint", "unverified_items"];
|
|
33
|
+
export declare const APPLY_EXECUTOR_REPORT_REQUIRED_FIELDS: readonly ["role", "task_id", "apply_worker_chain_id", "cwd", "repo_head", "guard_fingerprint", "changed_files", "suggested_green_checks", "test_invariant_mapping", "runtime_artifact_refs", "origin_packet_fingerprint", "input_ref_digest", "source_implementation_fingerprint", "produced_implementation_fingerprint", "unverified_items", "risk_notes"];
|
|
34
|
+
export declare const APPLY_CODE_REVIEW_REPORT_REQUIRED_FIELDS: readonly ["role", "review_status_candidate", "cwd", "repo_head", "guard_fingerprint", "executor_report_ref", "actual_changed_files", "changed_files", "untracked_files", "implementation_dirty_file_list", "implementation_fingerprint", "guard_artifact_manifest_fingerprint", "scope_verdict", "protected_path_verdict", "executor_report_mismatch", "test_invariant_mapping_verdict", "suggested_green_test_ids", "risk_notes", "runtime_raw_git_status_transcript_ref", "runtime_raw_git_diff_name_status_transcript_ref", "runtime_path_scoped_diff_transcript_refs", "origin_packet_fingerprint", "input_ref_digest", "source_implementation_fingerprint", "observed_implementation_fingerprint", "unverified_items"];
|
|
35
|
+
export declare const APPLY_VERIFIER_REPORT_REQUIRED_FIELDS: readonly ["role", "verification_status_candidate", "task_completion_verdict", "chain_consistency_verdict", "acceptance_coverage_verdict", "invariant_coverage_verdict", "test_coverage_verdict", "cwd", "repo_head", "guard_fingerprint", "expected_freshness_fingerprint", "observed_freshness_fingerprint", "freshness_verdict", "green_test_run_evidence_refs", "executor_report_ref", "task_code_review_report_ref", "actual_changed_files", "changed_files", "untracked_files", "implementation_dirty_file_list", "implementation_fingerprint", "guard_artifact_manifest_fingerprint", "unexpected_guard_owned_dirty_paths", "scope_verdict", "protected_path_verdict", "executor_code_review_mismatch", "test_evidence_mismatch", "runtime_raw_git_status_transcript_ref", "runtime_raw_git_diff_name_status_transcript_ref", "runtime_path_scoped_diff_transcript_refs", "diff_summary_refs", "origin_packet_fingerprint", "input_ref_digest", "source_implementation_fingerprint", "observed_implementation_fingerprint", "risk_notes", "triggered_stop_conditions", "unverified_items"];
|
|
36
|
+
export declare function apply_worker_implementation_fingerprint(repoRoot: string, changeRoot: string, expectedGuardRefs?: unknown[], opts?: {
|
|
37
|
+
declaredTaskWriteScope?: string[];
|
|
38
|
+
protectedPathRefs?: unknown[];
|
|
39
|
+
}): JsonMap;
|
|
40
|
+
export declare function apply_worker_protected_path_refs(repoRoot: string, changeRoot: string, expectedGuardRefs?: unknown[]): JsonMap[];
|
|
41
|
+
export declare function worker_input_ref_digest(refs: unknown[]): string;
|
|
42
|
+
export declare function apply_worker_executor_input_ref_digest(evidences: JsonMap[], active: JsonMap): string;
|
|
43
|
+
export declare function apply_worker_guard_artifact_manifest_fingerprint(items: JsonMap): JsonMap;
|
|
44
|
+
export declare function fingerprint_digest(value: unknown): string;
|
|
45
|
+
export declare function fingerprint_matches(actual: unknown, expected: unknown): boolean;
|
|
46
|
+
export declare function read_pinned_artifact_json(changeRoot: string, refItem: unknown): JsonMap | null;
|
|
47
|
+
export declare function materialize_apply_worker_artifact_ref(changeRoot: string, input: ApplyWorkerArtifactMaterializeInput): JsonMap;
|
|
48
|
+
export declare function pinned_artifact_ref_reasons(changeRoot: string, refItem: unknown, label: string, expected?: ArtifactRefExpected, code?: string): Reason[];
|
|
49
|
+
export declare function worker_test_run_reasons(changeRoot: string, ev: JsonMap, taskId: string, chainId: string | null, code?: string): Reason[];
|
|
50
|
+
export declare function pre_edit_evidence_ref_reasons(evidences: JsonMap[], active: JsonMap | null | undefined, taskId: string, code?: string): Reason[];
|
|
51
|
+
export declare function compute_apply_worker_freshness(repoRoot: string, changeRoot: string, evidences: JsonMap[], taskId: string, chainId: string, refs: {
|
|
52
|
+
executor_report_ref: unknown;
|
|
53
|
+
task_code_review_report_ref: unknown;
|
|
54
|
+
green_test_run_evidence_ref: string;
|
|
55
|
+
green_test_run_evidence_refs?: string[];
|
|
56
|
+
verifier_report_ref?: unknown;
|
|
57
|
+
}): JsonMap;
|