specrails-core 5.3.0 → 5.5.0
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 +2 -0
- package/dist/agent-runtime/capabilities.d.ts +28 -0
- package/dist/agent-runtime/capabilities.js +81 -0
- package/dist/agent-runtime/capabilities.js.map +1 -0
- package/dist/agent-runtime/cli-executor.d.ts +9 -0
- package/dist/agent-runtime/cli-executor.js +109 -34
- package/dist/agent-runtime/cli-executor.js.map +1 -1
- package/dist/agent-runtime/cli-process.d.ts +1 -0
- package/dist/agent-runtime/cli-process.js +13 -2
- package/dist/agent-runtime/cli-process.js.map +1 -1
- package/dist/agent-runtime/cli.d.ts +1 -0
- package/dist/agent-runtime/cli.js +60 -11
- package/dist/agent-runtime/cli.js.map +1 -1
- package/dist/agent-runtime/codex-schema.d.ts +4 -0
- package/dist/agent-runtime/codex-schema.js +31 -0
- package/dist/agent-runtime/codex-schema.js.map +1 -0
- package/dist/agent-runtime/compact/architect.d.ts +349 -0
- package/dist/agent-runtime/compact/architect.js +371 -0
- package/dist/agent-runtime/compact/architect.js.map +1 -0
- package/dist/agent-runtime/compact/chat-client.d.ts +83 -0
- package/dist/agent-runtime/compact/chat-client.js +307 -0
- package/dist/agent-runtime/compact/chat-client.js.map +1 -0
- package/dist/agent-runtime/compact/developer.d.ts +160 -0
- package/dist/agent-runtime/compact/developer.js +823 -0
- package/dist/agent-runtime/compact/developer.js.map +1 -0
- package/dist/agent-runtime/compact/environment.d.ts +62 -0
- package/dist/agent-runtime/compact/environment.js +213 -0
- package/dist/agent-runtime/compact/environment.js.map +1 -0
- package/dist/agent-runtime/compact/exit-code-honesty.d.ts +8 -0
- package/dist/agent-runtime/compact/exit-code-honesty.js +28 -0
- package/dist/agent-runtime/compact/exit-code-honesty.js.map +1 -0
- package/dist/agent-runtime/compact/guarded-loop.d.ts +73 -0
- package/dist/agent-runtime/compact/guarded-loop.js +320 -0
- package/dist/agent-runtime/compact/guarded-loop.js.map +1 -0
- package/dist/agent-runtime/compact/prompt-inputs.d.ts +42 -0
- package/dist/agent-runtime/compact/prompt-inputs.js +59 -0
- package/dist/agent-runtime/compact/prompt-inputs.js.map +1 -0
- package/dist/agent-runtime/compact/reviewer.d.ts +24 -0
- package/dist/agent-runtime/compact/reviewer.js +178 -0
- package/dist/agent-runtime/compact/reviewer.js.map +1 -0
- package/dist/agent-runtime/compact/step.d.ts +70 -0
- package/dist/agent-runtime/compact/step.js +136 -0
- package/dist/agent-runtime/compact/step.js.map +1 -0
- package/dist/agent-runtime/compact/test-reachability.d.ts +30 -0
- package/dist/agent-runtime/compact/test-reachability.js +147 -0
- package/dist/agent-runtime/compact/test-reachability.js.map +1 -0
- package/dist/agent-runtime/config.d.ts +4 -0
- package/dist/agent-runtime/config.js +146 -15
- package/dist/agent-runtime/config.js.map +1 -1
- package/dist/agent-runtime/core-host.d.ts +12 -4
- package/dist/agent-runtime/core-host.js +61 -21
- package/dist/agent-runtime/core-host.js.map +1 -1
- package/dist/agent-runtime/efficiency-summary.d.ts +67 -0
- package/dist/agent-runtime/efficiency-summary.js +52 -0
- package/dist/agent-runtime/efficiency-summary.js.map +1 -0
- package/dist/agent-runtime/efficiency-types.d.ts +60 -0
- package/dist/agent-runtime/efficiency-types.js +8 -0
- package/dist/agent-runtime/efficiency-types.js.map +1 -0
- package/dist/agent-runtime/efficiency.d.ts +5 -0
- package/dist/agent-runtime/efficiency.js +35 -0
- package/dist/agent-runtime/efficiency.js.map +1 -0
- package/dist/agent-runtime/evaluation-corpus.d.ts +13 -0
- package/dist/agent-runtime/evaluation-corpus.js +8 -0
- package/dist/agent-runtime/evaluation-corpus.js.map +1 -0
- package/dist/agent-runtime/evaluation.d.ts +43 -0
- package/dist/agent-runtime/evaluation.js +171 -0
- package/dist/agent-runtime/evaluation.js.map +1 -0
- package/dist/agent-runtime/executor-types.d.ts +71 -4
- package/dist/agent-runtime/executor-types.js +7 -2
- package/dist/agent-runtime/executor-types.js.map +1 -1
- package/dist/agent-runtime/executors.d.ts +1 -0
- package/dist/agent-runtime/executors.js +4 -0
- package/dist/agent-runtime/executors.js.map +1 -1
- package/dist/agent-runtime/graph/artifacts.d.ts +8 -22
- package/dist/agent-runtime/graph/artifacts.js +99 -73
- package/dist/agent-runtime/graph/artifacts.js.map +1 -1
- package/dist/agent-runtime/graph/nodes.d.ts +7 -2
- package/dist/agent-runtime/graph/nodes.js +207 -53
- package/dist/agent-runtime/graph/nodes.js.map +1 -1
- package/dist/agent-runtime/graph/roles.d.ts +11 -3
- package/dist/agent-runtime/graph/roles.js +109 -37
- package/dist/agent-runtime/graph/roles.js.map +1 -1
- package/dist/agent-runtime/graph/state.d.ts +10 -1
- package/dist/agent-runtime/graph/state.js +2 -1
- package/dist/agent-runtime/graph/state.js.map +1 -1
- package/dist/agent-runtime/guardrails.d.ts +15 -0
- package/dist/agent-runtime/guardrails.js +76 -0
- package/dist/agent-runtime/guardrails.js.map +1 -0
- package/dist/agent-runtime/index.d.ts +7 -1
- package/dist/agent-runtime/index.js +7 -1
- package/dist/agent-runtime/index.js.map +1 -1
- package/dist/agent-runtime/kimi-acp.d.ts +4 -0
- package/dist/agent-runtime/kimi-acp.js +20 -9
- package/dist/agent-runtime/kimi-acp.js.map +1 -1
- package/dist/agent-runtime/openai-executor.d.ts +33 -1
- package/dist/agent-runtime/openai-executor.js +76 -113
- package/dist/agent-runtime/openai-executor.js.map +1 -1
- package/dist/agent-runtime/openspec-tool-server.d.ts +1 -0
- package/dist/agent-runtime/openspec-tool-server.js +37 -0
- package/dist/agent-runtime/openspec-tool-server.js.map +1 -0
- package/dist/agent-runtime/openspec.d.ts +198 -0
- package/dist/agent-runtime/openspec.js +329 -0
- package/dist/agent-runtime/openspec.js.map +1 -0
- package/dist/agent-runtime/prompts.d.ts +24 -1
- package/dist/agent-runtime/prompts.js +112 -43
- package/dist/agent-runtime/prompts.js.map +1 -1
- package/dist/agent-runtime/provider-diagnostic.d.ts +2 -0
- package/dist/agent-runtime/provider-diagnostic.js +25 -0
- package/dist/agent-runtime/provider-diagnostic.js.map +1 -0
- package/dist/agent-runtime/repository-context.d.ts +25 -0
- package/dist/agent-runtime/repository-context.js +127 -0
- package/dist/agent-runtime/repository-context.js.map +1 -0
- package/dist/agent-runtime/review-context.d.ts +14 -0
- package/dist/agent-runtime/review-context.js +41 -0
- package/dist/agent-runtime/review-context.js.map +1 -0
- package/dist/agent-runtime/role-routing.d.ts +10 -0
- package/dist/agent-runtime/role-routing.js +30 -0
- package/dist/agent-runtime/role-routing.js.map +1 -0
- package/dist/agent-runtime/role-state.d.ts +19 -0
- package/dist/agent-runtime/role-state.js +24 -0
- package/dist/agent-runtime/role-state.js.map +1 -0
- package/dist/agent-runtime/runtime-identity.d.ts +11 -0
- package/dist/agent-runtime/runtime-identity.js +33 -0
- package/dist/agent-runtime/runtime-identity.js.map +1 -0
- package/dist/agent-runtime/tool-event.d.ts +3 -0
- package/dist/agent-runtime/tool-event.js +24 -0
- package/dist/agent-runtime/tool-event.js.map +1 -0
- package/dist/agent-runtime/verification-plan.d.ts +55 -0
- package/dist/agent-runtime/verification-plan.js +206 -0
- package/dist/agent-runtime/verification-plan.js.map +1 -0
- package/dist/agent-runtime/workflow-types.d.ts +19 -1
- package/dist/agent-runtime/workflow.js +29 -2
- package/dist/agent-runtime/workflow.js.map +1 -1
- package/dist/agent-runtime/workspace-tools.d.ts +4 -0
- package/dist/agent-runtime/workspace-tools.js +182 -20
- package/dist/agent-runtime/workspace-tools.js.map +1 -1
- package/dist/installer/phases/scaffold.js +39 -109
- package/dist/installer/phases/scaffold.js.map +1 -1
- package/dist/installer/runtime/pipeline-state.d.ts +143 -1
- package/dist/installer/runtime/pipeline-state.js +510 -30
- package/dist/installer/runtime/pipeline-state.js.map +1 -1
- package/docs/agent-runtime-efficiency.md +65 -0
- package/docs/agent-runtime.md +86 -15
- package/integration-contract.json +2 -1
- package/package.json +5 -2
- package/schemas/agent-runtime.schema.json +34 -4
- package/schemas/fixtures/runtime-efficiency-summary.v1.json +790 -0
- package/templates/codex-skills/batch-implement/SKILL.md +33 -58
- package/templates/codex-skills/implement/SKILL.md +21 -124
- package/templates/codex-skills/retry/SKILL.md +8 -34
- package/templates/commands/specrails/batch-implement.md +21 -16
- package/templates/commands/specrails/implement.md +17 -276
- package/templates/commands/specrails/retry.md +6 -34
- package/templates/gemini-commands/batch-implement.toml +34 -28
- package/templates/gemini-commands/implement.toml +34 -55
- package/templates/gemini-commands/retry.toml +10 -16
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import type { AgentRole, CliProvider } from './executor-types.js';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
export declare const OPENSPEC_VERSION = "1.4.1";
|
|
4
|
+
export declare const ROLE_SKILLS: {
|
|
5
|
+
readonly architect: "openspec-ff-change";
|
|
6
|
+
readonly developer: "openspec-apply-change";
|
|
7
|
+
readonly reviewer: "openspec-verify-change";
|
|
8
|
+
};
|
|
9
|
+
export interface OpenSpecRoleContext {
|
|
10
|
+
evidenceScope?: {
|
|
11
|
+
backlogRoot: string;
|
|
12
|
+
runId: string;
|
|
13
|
+
};
|
|
14
|
+
root: string;
|
|
15
|
+
change: string;
|
|
16
|
+
stateDirectory: string;
|
|
17
|
+
cli: string;
|
|
18
|
+
skillPath: string;
|
|
19
|
+
skillHash: string;
|
|
20
|
+
role: AgentRole;
|
|
21
|
+
}
|
|
22
|
+
export interface OpenSpecStatus {
|
|
23
|
+
changeRoot: string;
|
|
24
|
+
schemaName: string;
|
|
25
|
+
isComplete: boolean;
|
|
26
|
+
applyRequires: string[];
|
|
27
|
+
actionContext?: {
|
|
28
|
+
allowedEditRoots?: string[];
|
|
29
|
+
mode?: string;
|
|
30
|
+
};
|
|
31
|
+
artifacts: {
|
|
32
|
+
id: string;
|
|
33
|
+
status: string;
|
|
34
|
+
}[];
|
|
35
|
+
artifactPaths: Record<string, {
|
|
36
|
+
existingOutputPaths: string[];
|
|
37
|
+
resolvedOutputPath: string;
|
|
38
|
+
}>;
|
|
39
|
+
}
|
|
40
|
+
export interface OpenSpecApply {
|
|
41
|
+
state: 'blocked' | 'ready' | 'all_done';
|
|
42
|
+
contextFiles: Record<string, string | string[]>;
|
|
43
|
+
tasks: {
|
|
44
|
+
id: string;
|
|
45
|
+
description: string;
|
|
46
|
+
done: boolean;
|
|
47
|
+
}[];
|
|
48
|
+
progress: {
|
|
49
|
+
total: number;
|
|
50
|
+
complete: number;
|
|
51
|
+
remaining: number;
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
/** Advisory implementation memory, deliberately separate from verification receipts. */
|
|
55
|
+
export declare const IMPLEMENTATION_PROGRESS_SCHEMA: z.ZodObject<{
|
|
56
|
+
summary: z.ZodString;
|
|
57
|
+
completedTasks: z.ZodArray<z.ZodString>;
|
|
58
|
+
nextTasks: z.ZodArray<z.ZodString>;
|
|
59
|
+
checks: z.ZodArray<z.ZodObject<{
|
|
60
|
+
command: z.ZodString;
|
|
61
|
+
outcome: z.ZodString;
|
|
62
|
+
}, z.core.$strict>>;
|
|
63
|
+
blockers: z.ZodArray<z.ZodString>;
|
|
64
|
+
}, z.core.$strict>;
|
|
65
|
+
export declare function renderProgressHandoff(context: OpenSpecRoleContext): string;
|
|
66
|
+
export declare function hash(text: string): string;
|
|
67
|
+
export declare function resolveOpenSpecCli(): string;
|
|
68
|
+
export declare function runOpenSpec(cli: string, root: string, args: string[], signal?: AbortSignal): Promise<string>;
|
|
69
|
+
/** Reject symlink traversal even when the final destination does not exist. */
|
|
70
|
+
export declare function artifactPath(root: string, relative: string): string;
|
|
71
|
+
/** CLI-generated skills, never reimplemented templates. No user/global config writes. */
|
|
72
|
+
export declare function prepareOpenSpec(root: string, change: string, directory: string): {
|
|
73
|
+
cli: string;
|
|
74
|
+
skillRoot: string;
|
|
75
|
+
identity: Record<string, string>;
|
|
76
|
+
};
|
|
77
|
+
export declare function roleOpenSpecContext(prepared: ReturnType<typeof prepareOpenSpec>, root: string, change: string, directory: string, role: AgentRole, provider: CliProvider): OpenSpecRoleContext;
|
|
78
|
+
/** OpenSpec uses cwd paths; Windows may report a different case or short-name
|
|
79
|
+
* spelling than realpathSync. Compare existing filesystem identities, not text. */
|
|
80
|
+
export declare function sameOpenSpecDirectory(candidate: unknown, expected: string): boolean;
|
|
81
|
+
export declare class OpenSpecTools {
|
|
82
|
+
readonly context: OpenSpecRoleContext;
|
|
83
|
+
private readonly signal?;
|
|
84
|
+
constructor(context: OpenSpecRoleContext, signal?: AbortSignal | undefined);
|
|
85
|
+
private call;
|
|
86
|
+
status(): Promise<OpenSpecStatus>;
|
|
87
|
+
apply(): Promise<OpenSpecApply>;
|
|
88
|
+
validate(): Promise<unknown>;
|
|
89
|
+
execute(input: {
|
|
90
|
+
action: string;
|
|
91
|
+
artifact?: string;
|
|
92
|
+
path?: string;
|
|
93
|
+
content?: string;
|
|
94
|
+
progress?: unknown;
|
|
95
|
+
}): Promise<unknown>;
|
|
96
|
+
private participationEvents;
|
|
97
|
+
participationCursor(): number;
|
|
98
|
+
assertParticipation(after?: number): void;
|
|
99
|
+
assertReady(): Promise<OpenSpecApply>;
|
|
100
|
+
}
|
|
101
|
+
export declare const OPENSPEC_BRIDGE_ENTRY: string;
|
|
102
|
+
export declare const OPENSPEC_TOOL_ACTIONS: readonly ["load_skill", "new", "status", "instructions", "validate", "write_artifact", "read_progress", "write_progress"];
|
|
103
|
+
export declare const OPENSPEC_TOOL_DEFINITION: {
|
|
104
|
+
type: string;
|
|
105
|
+
function: {
|
|
106
|
+
name: string;
|
|
107
|
+
description: string;
|
|
108
|
+
parameters: {
|
|
109
|
+
type: string;
|
|
110
|
+
additionalProperties: boolean;
|
|
111
|
+
required: string[];
|
|
112
|
+
properties: {
|
|
113
|
+
action: {
|
|
114
|
+
type: string;
|
|
115
|
+
enum: readonly ["load_skill", "new", "status", "instructions", "validate", "write_artifact", "read_progress", "write_progress"];
|
|
116
|
+
};
|
|
117
|
+
artifact: {
|
|
118
|
+
type: string;
|
|
119
|
+
};
|
|
120
|
+
path: {
|
|
121
|
+
type: string;
|
|
122
|
+
};
|
|
123
|
+
content: {
|
|
124
|
+
type: string;
|
|
125
|
+
};
|
|
126
|
+
progress: {
|
|
127
|
+
type: string;
|
|
128
|
+
additionalProperties: boolean;
|
|
129
|
+
required: string[];
|
|
130
|
+
properties: {
|
|
131
|
+
summary: {
|
|
132
|
+
type: string;
|
|
133
|
+
minLength: number;
|
|
134
|
+
maxLength: number;
|
|
135
|
+
};
|
|
136
|
+
completedTasks: {
|
|
137
|
+
type: string;
|
|
138
|
+
maxItems: number;
|
|
139
|
+
items: {
|
|
140
|
+
type: string;
|
|
141
|
+
minLength: number;
|
|
142
|
+
maxLength: number;
|
|
143
|
+
};
|
|
144
|
+
};
|
|
145
|
+
nextTasks: {
|
|
146
|
+
type: string;
|
|
147
|
+
maxItems: number;
|
|
148
|
+
items: {
|
|
149
|
+
type: string;
|
|
150
|
+
minLength: number;
|
|
151
|
+
maxLength: number;
|
|
152
|
+
};
|
|
153
|
+
};
|
|
154
|
+
checks: {
|
|
155
|
+
type: string;
|
|
156
|
+
maxItems: number;
|
|
157
|
+
items: {
|
|
158
|
+
type: string;
|
|
159
|
+
additionalProperties: boolean;
|
|
160
|
+
required: string[];
|
|
161
|
+
properties: {
|
|
162
|
+
command: {
|
|
163
|
+
type: string;
|
|
164
|
+
minLength: number;
|
|
165
|
+
maxLength: number;
|
|
166
|
+
};
|
|
167
|
+
outcome: {
|
|
168
|
+
type: string;
|
|
169
|
+
minLength: number;
|
|
170
|
+
maxLength: number;
|
|
171
|
+
};
|
|
172
|
+
};
|
|
173
|
+
};
|
|
174
|
+
};
|
|
175
|
+
blockers: {
|
|
176
|
+
type: string;
|
|
177
|
+
maxItems: number;
|
|
178
|
+
items: {
|
|
179
|
+
type: string;
|
|
180
|
+
minLength: number;
|
|
181
|
+
maxLength: number;
|
|
182
|
+
};
|
|
183
|
+
};
|
|
184
|
+
};
|
|
185
|
+
};
|
|
186
|
+
};
|
|
187
|
+
};
|
|
188
|
+
};
|
|
189
|
+
};
|
|
190
|
+
export declare function openSpecPrompt(context: OpenSpecRoleContext): string;
|
|
191
|
+
export declare function writeOpenSpecBridge(context: OpenSpecRoleContext, directory: string): {
|
|
192
|
+
command: string;
|
|
193
|
+
args: string[];
|
|
194
|
+
};
|
|
195
|
+
/** A repairable protocol omission, distinct from invalid artifacts or failed verification. */
|
|
196
|
+
export declare class OpenSpecParticipationError extends Error {
|
|
197
|
+
}
|
|
198
|
+
export declare function openSpecRepairPrompt(context: OpenSpecRoleContext): string;
|
|
@@ -0,0 +1,329 @@
|
|
|
1
|
+
import { promisify } from 'node:util';
|
|
2
|
+
import { execFile, execFileSync } from 'node:child_process';
|
|
3
|
+
import { createHash, randomUUID } from 'node:crypto';
|
|
4
|
+
import { appendFileSync, existsSync, lstatSync, mkdirSync, mkdtempSync, readFileSync, realpathSync, renameSync, rmSync, writeFileSync } from 'node:fs';
|
|
5
|
+
import { createRequire } from 'node:module';
|
|
6
|
+
import path from 'node:path';
|
|
7
|
+
import { fileURLToPath } from 'node:url';
|
|
8
|
+
import { z } from 'zod';
|
|
9
|
+
export const OPENSPEC_VERSION = '1.4.1';
|
|
10
|
+
export const ROLE_SKILLS = { architect: 'openspec-ff-change', developer: 'openspec-apply-change', reviewer: 'openspec-verify-change' };
|
|
11
|
+
/** Advisory implementation memory, deliberately separate from verification receipts. */
|
|
12
|
+
export const IMPLEMENTATION_PROGRESS_SCHEMA = z.object({
|
|
13
|
+
summary: z.string().trim().min(1).max(1600),
|
|
14
|
+
completedTasks: z.array(z.string().trim().min(1).max(400)).max(20),
|
|
15
|
+
nextTasks: z.array(z.string().trim().min(1).max(400)).max(20),
|
|
16
|
+
checks: z.array(z.object({ command: z.string().trim().min(1).max(1000), outcome: z.string().trim().min(1).max(500) }).strict()).max(12),
|
|
17
|
+
blockers: z.array(z.string().trim().min(1).max(500)).max(12),
|
|
18
|
+
}).strict();
|
|
19
|
+
const MAX_PROGRESS_BYTES = 8 * 1024;
|
|
20
|
+
const PROGRESS_FILE = 'implementation-progress.json';
|
|
21
|
+
const PROGRESS_NOTICE = 'Advisory developer handoff only. Reconcile with current files and OpenSpec tasks; recorded checks are historical claims, not host verification receipts or permission to skip required verification.';
|
|
22
|
+
function readProgress(context) {
|
|
23
|
+
try {
|
|
24
|
+
const file = artifactPath(context.stateDirectory, PROGRESS_FILE);
|
|
25
|
+
if (!existsSync(file))
|
|
26
|
+
return { notice: PROGRESS_NOTICE, record: null };
|
|
27
|
+
if (!lstatSync(file).isFile() || lstatSync(file).size > MAX_PROGRESS_BYTES)
|
|
28
|
+
throw new Error('Invalid progress file');
|
|
29
|
+
const record = JSON.parse(readFileSync(file, 'utf8'));
|
|
30
|
+
if (record.schemaVersion !== 1 || !sameOpenSpecDirectory(record.root, context.root) || record.change !== context.change || typeof record.updatedAt !== 'string' || !Number.isFinite(Date.parse(record.updatedAt)))
|
|
31
|
+
throw new Error('Progress scope mismatch');
|
|
32
|
+
const progress = IMPLEMENTATION_PROGRESS_SCHEMA.parse(record.progress);
|
|
33
|
+
return { notice: PROGRESS_NOTICE, record: { schemaVersion: 1, root: record.root, change: record.change, updatedAt: record.updatedAt, progress } };
|
|
34
|
+
}
|
|
35
|
+
catch {
|
|
36
|
+
return { notice: PROGRESS_NOTICE + ' Saved progress is unavailable or invalid; inspect the current diff and tasks before continuing.', record: null };
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
export function renderProgressHandoff(context) {
|
|
40
|
+
const saved = readProgress(context);
|
|
41
|
+
return saved.record ? `\n## Saved implementation progress\n${saved.notice}\n${JSON.stringify(saved.record)}\n` : saved.notice.includes('unavailable') ? '\n' + saved.notice + '\n' : '';
|
|
42
|
+
}
|
|
43
|
+
function writeProgress(context, input) {
|
|
44
|
+
if (context.role !== 'developer')
|
|
45
|
+
throw new Error('Only the developer may write implementation progress');
|
|
46
|
+
const progress = IMPLEMENTATION_PROGRESS_SCHEMA.parse(input);
|
|
47
|
+
const record = { schemaVersion: 1, root: realpathSync(context.root), change: context.change, updatedAt: new Date().toISOString(), progress };
|
|
48
|
+
const content = JSON.stringify(record);
|
|
49
|
+
if (Buffer.byteLength(content) > MAX_PROGRESS_BYTES)
|
|
50
|
+
throw new Error('Implementation progress exceeds 8 KB; summarize the current state');
|
|
51
|
+
const target = artifactPath(context.stateDirectory, PROGRESS_FILE);
|
|
52
|
+
const temporary = artifactPath(context.stateDirectory, `.implementation-progress-${randomUUID()}.tmp`);
|
|
53
|
+
try {
|
|
54
|
+
writeFileSync(temporary, content, { mode: 0o600, flag: 'wx' });
|
|
55
|
+
renameSync(temporary, target);
|
|
56
|
+
}
|
|
57
|
+
finally {
|
|
58
|
+
rmSync(temporary, { force: true });
|
|
59
|
+
}
|
|
60
|
+
return { notice: PROGRESS_NOTICE, record };
|
|
61
|
+
}
|
|
62
|
+
export function hash(text) { return createHash('sha256').update(text).digest('hex'); }
|
|
63
|
+
export function resolveOpenSpecCli() {
|
|
64
|
+
const require = createRequire(import.meta.url);
|
|
65
|
+
const pkg = path.resolve(path.dirname(require.resolve('@fission-ai/openspec')), '../package.json');
|
|
66
|
+
const manifest = JSON.parse(readFileSync(pkg, 'utf8'));
|
|
67
|
+
if (manifest.version !== OPENSPEC_VERSION)
|
|
68
|
+
throw new Error(`OpenSpec ${OPENSPEC_VERSION} required; found ${manifest.version}`);
|
|
69
|
+
return path.join(path.dirname(pkg), 'bin/openspec.js');
|
|
70
|
+
}
|
|
71
|
+
export async function runOpenSpec(cli, root, args, signal) {
|
|
72
|
+
try {
|
|
73
|
+
const result = await promisify(execFile)(process.execPath, [cli, ...args], {
|
|
74
|
+
cwd: root, signal, encoding: 'utf8', timeout: 30_000, maxBuffer: 4 * 1024 * 1024,
|
|
75
|
+
env: { ...process.env, OPENSPEC_TELEMETRY: '0', DO_NOT_TRACK: '1', CI: '1' },
|
|
76
|
+
});
|
|
77
|
+
return result.stdout;
|
|
78
|
+
}
|
|
79
|
+
catch (error) {
|
|
80
|
+
const result = error;
|
|
81
|
+
throw new Error(`OpenSpec ${args[0]} failed (${result.status ?? 'process error'}): ${String(result.stderr || result.stdout || '').slice(-6000)}`);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
/** Reject symlink traversal even when the final destination does not exist. */
|
|
85
|
+
export function artifactPath(root, relative) {
|
|
86
|
+
if (!relative || path.isAbsolute(relative) || relative.split(/[\\/]/).some(part => !part || part === '.' || part === '..'))
|
|
87
|
+
throw new Error('Invalid artifact path');
|
|
88
|
+
let target = realpathSync(root);
|
|
89
|
+
for (const part of relative.split(/[\\/]/)) {
|
|
90
|
+
target = path.join(target, part);
|
|
91
|
+
try {
|
|
92
|
+
if (lstatSync(target).isSymbolicLink())
|
|
93
|
+
throw new Error('Artifact symlinks are forbidden');
|
|
94
|
+
}
|
|
95
|
+
catch (error) {
|
|
96
|
+
if (error.code !== 'ENOENT')
|
|
97
|
+
throw error;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return target;
|
|
101
|
+
}
|
|
102
|
+
/** CLI-generated skills, never reimplemented templates. No user/global config writes. */
|
|
103
|
+
export function prepareOpenSpec(root, change, directory) {
|
|
104
|
+
if (!/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(change))
|
|
105
|
+
throw new Error('Invalid OpenSpec change name');
|
|
106
|
+
const cli = resolveOpenSpecCli();
|
|
107
|
+
mkdirSync(directory, { recursive: true });
|
|
108
|
+
const skillRoot = path.join(directory, 'openspec-skills');
|
|
109
|
+
const marker = path.join(skillRoot, 'ready.json');
|
|
110
|
+
if (existsSync(marker) && JSON.parse(readFileSync(marker, 'utf8')).version !== OPENSPEC_VERSION)
|
|
111
|
+
throw new Error('Saved OpenSpec skill version is incompatible; start a new run');
|
|
112
|
+
if (!existsSync(marker)) {
|
|
113
|
+
const staging = mkdtempSync(path.join(directory, '.prepare-openspec-'));
|
|
114
|
+
try {
|
|
115
|
+
const config = path.join(staging, 'config');
|
|
116
|
+
mkdirSync(path.join(config, 'openspec'), { recursive: true });
|
|
117
|
+
writeFileSync(path.join(config, 'openspec/config.json'), JSON.stringify({ profile: 'custom', delivery: 'skills', workflows: ['ff', 'apply', 'verify'], featureFlags: {} }));
|
|
118
|
+
const target = path.join(staging, 'project');
|
|
119
|
+
mkdirSync(target);
|
|
120
|
+
execFileSync(process.execPath, [cli, 'init', '--tools', 'claude,codex,gemini,kimi', '--profile', 'custom', target], {
|
|
121
|
+
cwd: target, encoding: 'utf8', timeout: 60_000,
|
|
122
|
+
env: { ...process.env, XDG_CONFIG_HOME: config, OPENSPEC_TELEMETRY: '0', DO_NOT_TRACK: '1', CI: '1' }, stdio: ['ignore', 'pipe', 'pipe'],
|
|
123
|
+
});
|
|
124
|
+
for (const provider of ['claude', 'codex', 'gemini', 'kimi']) {
|
|
125
|
+
for (const name of Object.values(ROLE_SKILLS)) {
|
|
126
|
+
const content = readFileSync(path.join(target, '.' + provider, 'skills', name, 'SKILL.md'), 'utf8');
|
|
127
|
+
const destination = path.join(skillRoot, provider, name);
|
|
128
|
+
mkdirSync(destination, { recursive: true });
|
|
129
|
+
writeFileSync(path.join(destination, 'SKILL.md'), content, { mode: 0o600 });
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
writeFileSync(marker, JSON.stringify({ version: OPENSPEC_VERSION }));
|
|
133
|
+
}
|
|
134
|
+
finally {
|
|
135
|
+
rmSync(staging, { recursive: true, force: true });
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
const identity = { version: OPENSPEC_VERSION, root: realpathSync(root), change };
|
|
139
|
+
for (const provider of ['claude', 'codex', 'gemini', 'kimi'])
|
|
140
|
+
for (const name of Object.values(ROLE_SKILLS)) {
|
|
141
|
+
identity[`${provider}/${name}`] = hash(readFileSync(path.join(skillRoot, provider, name, 'SKILL.md'), 'utf8'));
|
|
142
|
+
}
|
|
143
|
+
if (existsSync(path.join(root, 'openspec/schemas/spec-driven')))
|
|
144
|
+
throw new Error('Custom spec-driven schema overrides are not supported by this runtime');
|
|
145
|
+
const config = artifactPath(root, 'openspec/config.yaml');
|
|
146
|
+
identity.projectConfig = existsSync(config) ? hash(readFileSync(config, 'utf8')) : 'absent';
|
|
147
|
+
return { cli, skillRoot, identity };
|
|
148
|
+
}
|
|
149
|
+
export function roleOpenSpecContext(prepared, root, change, directory, role, provider) {
|
|
150
|
+
return { root, change, stateDirectory: directory, cli: prepared.cli, role,
|
|
151
|
+
skillPath: path.join(prepared.skillRoot, provider, ROLE_SKILLS[role], 'SKILL.md'),
|
|
152
|
+
skillHash: prepared.identity[`${provider}/${ROLE_SKILLS[role]}`],
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
/** OpenSpec uses cwd paths; Windows may report a different case or short-name
|
|
156
|
+
* spelling than realpathSync. Compare existing filesystem identities, not text. */
|
|
157
|
+
export function sameOpenSpecDirectory(candidate, expected) {
|
|
158
|
+
if (typeof candidate !== 'string' || !path.isAbsolute(candidate))
|
|
159
|
+
return false;
|
|
160
|
+
try {
|
|
161
|
+
return path.relative(realpathSync.native(candidate), realpathSync.native(expected)) === '';
|
|
162
|
+
}
|
|
163
|
+
catch {
|
|
164
|
+
return false;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
export class OpenSpecTools {
|
|
168
|
+
context;
|
|
169
|
+
signal;
|
|
170
|
+
constructor(context, signal) {
|
|
171
|
+
this.context = context;
|
|
172
|
+
this.signal = signal;
|
|
173
|
+
}
|
|
174
|
+
async call(args) { return JSON.parse(await runOpenSpec(this.context.cli, this.context.root, args, this.signal)); }
|
|
175
|
+
async status() {
|
|
176
|
+
const metadata = artifactPath(this.context.root, `openspec/changes/${this.context.change}/.openspec.yaml`);
|
|
177
|
+
if (!existsSync(metadata))
|
|
178
|
+
throw new Error('OpenSpec change metadata is missing; the architect must create the change with OpenSpec');
|
|
179
|
+
const status = await this.call(['status', '--change', this.context.change, '--json']);
|
|
180
|
+
const expected = artifactPath(this.context.root, `openspec/changes/${this.context.change}`);
|
|
181
|
+
if (!sameOpenSpecDirectory(status.changeRoot, expected) || status.schemaName !== 'spec-driven' || status.actionContext?.mode !== 'repo-local' || !status.actionContext?.allowedEditRoots?.some(root => sameOpenSpecDirectory(root, this.context.root)))
|
|
182
|
+
throw new Error('Unsupported OpenSpec planning root or schema; select an admitted repo-local spec-driven change');
|
|
183
|
+
return status;
|
|
184
|
+
}
|
|
185
|
+
async apply() { await this.status(); return await this.call(['instructions', 'apply', '--change', this.context.change, '--json']); }
|
|
186
|
+
async validate() { await this.status(); return this.call(['validate', this.context.change, '--strict', '--json']); }
|
|
187
|
+
async execute(input) {
|
|
188
|
+
this.signal?.throwIfAborted();
|
|
189
|
+
const { action } = input;
|
|
190
|
+
const log = path.join(this.context.stateDirectory, `openspec-${this.context.role}.jsonl`);
|
|
191
|
+
const history = existsSync(log) ? readFileSync(log, 'utf8').trim().split('\n').filter(Boolean).map(line => JSON.parse(line)) : [];
|
|
192
|
+
if (action !== 'load_skill' && !history.some(item => item.action === 'load_skill'))
|
|
193
|
+
throw new Error('Load the official role skill first');
|
|
194
|
+
let result;
|
|
195
|
+
const prerequisites = [];
|
|
196
|
+
if (action === 'load_skill') {
|
|
197
|
+
const content = readFileSync(this.context.skillPath, 'utf8');
|
|
198
|
+
if (hash(content) !== this.context.skillHash)
|
|
199
|
+
throw new Error('OpenSpec skill changed since admission');
|
|
200
|
+
// Both official apply and verify start with these read-only CLI queries.
|
|
201
|
+
// Execute them as part of the agent's tool request and return their actual
|
|
202
|
+
// outputs, so loading a skill cannot omit its required planning context.
|
|
203
|
+
const planning = this.context.role === 'architect' ? undefined : {
|
|
204
|
+
status: await this.status(),
|
|
205
|
+
apply: await this.call(['instructions', 'apply', '--change', this.context.change, '--json']),
|
|
206
|
+
};
|
|
207
|
+
if (planning)
|
|
208
|
+
prerequisites.push({ action: 'status', via: 'load_skill' }, { action: 'instructions', artifact: 'apply', via: 'load_skill' });
|
|
209
|
+
result = { name: ROLE_SKILLS[this.context.role], source: this.context.skillPath, version: OPENSPEC_VERSION, content,
|
|
210
|
+
...(planning ? { planning, next: 'The official status and instructions apply queries have executed for this request. Read every planning.apply.contextFiles path, then perform the remaining role skill steps. This is planning context, not proof that implementation or review is complete.' } : {}),
|
|
211
|
+
...(this.context.role !== 'architect' ? { savedProgress: readProgress(this.context) } : {}),
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
else if (action === 'new') {
|
|
215
|
+
if (this.context.role !== 'architect')
|
|
216
|
+
throw new Error('Only the architect can create a change');
|
|
217
|
+
const target = artifactPath(this.context.root, `openspec/changes/${this.context.change}`);
|
|
218
|
+
result = existsSync(target) ? await this.status() : await this.call(['new', 'change', this.context.change, '--json']);
|
|
219
|
+
await this.status();
|
|
220
|
+
}
|
|
221
|
+
else if (action === 'read_progress')
|
|
222
|
+
result = readProgress(this.context);
|
|
223
|
+
else if (action === 'write_progress')
|
|
224
|
+
result = writeProgress(this.context, input.progress);
|
|
225
|
+
else if (action === 'status')
|
|
226
|
+
result = await this.status();
|
|
227
|
+
else if (action === 'instructions') {
|
|
228
|
+
const status = await this.status();
|
|
229
|
+
if (input.artifact !== 'apply' && !status.artifacts.some(item => item.id === input.artifact))
|
|
230
|
+
throw new Error('Unknown OpenSpec artifact');
|
|
231
|
+
result = await this.call(['instructions', input.artifact, '--change', this.context.change, '--json']);
|
|
232
|
+
}
|
|
233
|
+
else if (action === 'validate')
|
|
234
|
+
result = await this.validate();
|
|
235
|
+
else if (action === 'write_artifact') {
|
|
236
|
+
if (this.context.role === 'reviewer')
|
|
237
|
+
throw new Error('Reviewer cannot write artifacts');
|
|
238
|
+
const status = await this.status();
|
|
239
|
+
if (!input.path?.endsWith('.md') || typeof input.content !== 'string' || Buffer.byteLength(input.content) > 256 * 1024)
|
|
240
|
+
throw new Error('Invalid artifact content');
|
|
241
|
+
if (this.context.role === 'developer' && input.path !== 'tasks.md')
|
|
242
|
+
throw new Error('Developer may update only OpenSpec tasks');
|
|
243
|
+
if (!['proposal.md', 'design.md', 'tasks.md'].includes(input.path) && !/^specs\/[a-z0-9-]+\/spec\.md$/.test(input.path))
|
|
244
|
+
throw new Error('Not a spec-driven artifact');
|
|
245
|
+
const artifact = input.path.startsWith('specs/') ? 'specs' : input.path.replace('.md', '');
|
|
246
|
+
if (!['ready', 'done'].includes(status.artifacts.find(item => item.id === artifact)?.status ?? ''))
|
|
247
|
+
throw new Error('OpenSpec dependencies are incomplete for this artifact');
|
|
248
|
+
if (!history.some(item => item.action === 'instructions' && item.artifact === (this.context.role === 'developer' ? 'apply' : artifact)))
|
|
249
|
+
throw new Error('Read OpenSpec instructions before writing this artifact');
|
|
250
|
+
const target = artifactPath(status.changeRoot, input.path);
|
|
251
|
+
if (this.context.role === 'developer') {
|
|
252
|
+
const normalize = (text) => text.replace(/^(\s*-\s+)\[[ x]\]/gm, '$1[ ]');
|
|
253
|
+
if (normalize(readFileSync(target, 'utf8')) !== normalize(input.content))
|
|
254
|
+
throw new Error('Developer may change only task checkboxes');
|
|
255
|
+
}
|
|
256
|
+
this.signal?.throwIfAborted();
|
|
257
|
+
mkdirSync(path.dirname(target), { recursive: true });
|
|
258
|
+
writeFileSync(target, input.content, 'utf8');
|
|
259
|
+
result = { written: target, sha256: hash(input.content) };
|
|
260
|
+
}
|
|
261
|
+
else
|
|
262
|
+
throw new Error('Unsupported OpenSpec operation');
|
|
263
|
+
this.signal?.throwIfAborted();
|
|
264
|
+
const timestamp = new Date().toISOString();
|
|
265
|
+
appendFileSync(log, [{ action, artifact: input.artifact, path: input.path }, ...prerequisites]
|
|
266
|
+
.map(event => JSON.stringify({ ...event, timestamp }) + '\n').join(''), { mode: 0o600 });
|
|
267
|
+
return result;
|
|
268
|
+
}
|
|
269
|
+
participationEvents() {
|
|
270
|
+
const log = path.join(this.context.stateDirectory, `openspec-${this.context.role}.jsonl`);
|
|
271
|
+
return existsSync(log) ? readFileSync(log, 'utf8').trim().split('\n').filter(Boolean).map(line => JSON.parse(line)) : [];
|
|
272
|
+
}
|
|
273
|
+
participationCursor() { return this.participationEvents().length; }
|
|
274
|
+
assertParticipation(after = 0) {
|
|
275
|
+
const rows = this.participationEvents().slice(after);
|
|
276
|
+
const artifact = this.context.role === 'architect' ? 'tasks' : 'apply';
|
|
277
|
+
const missing = [!rows.some(row => row.action === 'load_skill') ? 'load_skill' : '', !rows.some(row => row.action === 'instructions' && row.artifact === artifact) ? `instructions ${artifact}` : ''].filter(Boolean);
|
|
278
|
+
if (missing.length)
|
|
279
|
+
throw new OpenSpecParticipationError(`Required OpenSpec role workflow was not executed: ${this.context.role} must execute ${ROLE_SKILLS[this.context.role]} (missing ${missing.join(', ')})`);
|
|
280
|
+
}
|
|
281
|
+
async assertReady() {
|
|
282
|
+
const status = await this.status();
|
|
283
|
+
if (!status.isComplete)
|
|
284
|
+
throw new Error('OpenSpec planning artifacts remain incomplete');
|
|
285
|
+
const apply = await this.call(['instructions', 'apply', '--change', this.context.change, '--json']);
|
|
286
|
+
if (apply.state === 'blocked' || !apply.progress.total)
|
|
287
|
+
throw new Error('OpenSpec apply is blocked');
|
|
288
|
+
for (const files of Object.values(apply.contextFiles))
|
|
289
|
+
for (const file of (Array.isArray(files) ? files : [files])) {
|
|
290
|
+
const relative = path.relative(status.changeRoot, file);
|
|
291
|
+
const safe = artifactPath(status.changeRoot, relative);
|
|
292
|
+
if (!readFileSync(safe, 'utf8').trim())
|
|
293
|
+
throw new Error('Empty OpenSpec artifact: ' + relative);
|
|
294
|
+
}
|
|
295
|
+
for (const name of ['proposal.md', 'design.md', 'tasks.md']) {
|
|
296
|
+
if (!readFileSync(artifactPath(status.changeRoot, name), 'utf8').trim())
|
|
297
|
+
throw new Error('Empty OpenSpec artifact: ' + name);
|
|
298
|
+
}
|
|
299
|
+
await this.call(['validate', this.context.change, '--strict', '--json']);
|
|
300
|
+
return apply;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
export const OPENSPEC_BRIDGE_ENTRY = fileURLToPath(new URL('./openspec-tool-server.js', import.meta.url));
|
|
304
|
+
export const OPENSPEC_TOOL_ACTIONS = ['load_skill', 'new', 'status', 'instructions', 'validate', 'write_artifact', 'read_progress', 'write_progress'];
|
|
305
|
+
export const OPENSPEC_TOOL_DEFINITION = { type: 'function', function: { name: 'openspec_workflow', description: 'Run the official OpenSpec role workflow. Load the skill first (developer/reviewer also receive real status, apply context and saved progress), then use its CLI instructions and write artifacts within the fixed change. Developer may save a bounded advisory handoff with write_progress; read_progress refreshes it. Progress never substitutes for verification.', parameters: { type: 'object', additionalProperties: false, required: ['action'], properties: { action: { type: 'string', enum: OPENSPEC_TOOL_ACTIONS }, artifact: { type: 'string' }, path: { type: 'string' }, content: { type: 'string' }, progress: {
|
|
306
|
+
type: 'object', additionalProperties: false, required: ['summary', 'completedTasks', 'nextTasks', 'checks', 'blockers'], properties: {
|
|
307
|
+
summary: { type: 'string', minLength: 1, maxLength: 1600 },
|
|
308
|
+
completedTasks: { type: 'array', maxItems: 20, items: { type: 'string', minLength: 1, maxLength: 400 } },
|
|
309
|
+
nextTasks: { type: 'array', maxItems: 20, items: { type: 'string', minLength: 1, maxLength: 400 } },
|
|
310
|
+
checks: { type: 'array', maxItems: 12, items: { type: 'object', additionalProperties: false, required: ['command', 'outcome'], properties: { command: { type: 'string', minLength: 1, maxLength: 1000 }, outcome: { type: 'string', minLength: 1, maxLength: 500 } } } },
|
|
311
|
+
blockers: { type: 'array', maxItems: 12, items: { type: 'string', minLength: 1, maxLength: 500 } },
|
|
312
|
+
},
|
|
313
|
+
} } } } };
|
|
314
|
+
export function openSpecPrompt(context) {
|
|
315
|
+
return `\n## Official OpenSpec workflow binding\nExecute ${ROLE_SKILLS[context.role]} for change ${context.change}. This headless transport loads the official, version-pinned skill through the openspec_workflow tool (MCP server specrails_openspec, tool workflow on CLI providers). This is explicit skill-document adaptation, not a native slash command.\nFirst call action=load_skill and follow the returned complete official skill. Bind its openspec CLI commands to this tool: new change -> action=new; status -> status; instructions <artifact> -> instructions with artifact; validate -> validate. Author each artifact yourself using write_artifact with its change-relative path and content; read the official instructions first. Do not reproduce templates from memory or return the artifacts in final JSON. The tool fixes the change identity and runs OpenSpec ${OPENSPEC_VERSION}.\nRead source/dependencies with your normal read tools. For this frozen scope, change selection is already answered. Bind AskUserQuestion to a low-confidence final result with question (architect), or a reported blocking issue (other roles); LangGraph asks the requester. Bind TodoWrite to concise progress narration and, for developer, persist the current handoff through action=write_progress with progress {summary, completedTasks, nextTasks, checks: [{command, outcome}], blockers}. Save after each completed task or changed blocker, at most 8 KB. This host journal is separate from frozen OpenSpec artifacts; never write runtime files directly. Developer/reviewer receive savedProgress from load_skill and can refresh with read_progress. Reconcile this advisory history with current files; old test outcomes never replace required host verification. Do not invoke another role, apply/archive from architect, or archive from developer/reviewer. Return the Specrails JSON report after the official workflow. For developer and reviewer, load_skill already executes status and instructions apply and returns their real outputs in planning; read planning.apply.contextFiles and perform the rest of the official skill. You may refresh instructions apply when needed. Verify is a skill, not an instructions artifact.\n`;
|
|
316
|
+
}
|
|
317
|
+
export function writeOpenSpecBridge(context, directory) {
|
|
318
|
+
const file = path.join(directory, 'openspec-context.json');
|
|
319
|
+
writeFileSync(file, JSON.stringify(context), { mode: 0o600 });
|
|
320
|
+
return { command: process.execPath, args: [OPENSPEC_BRIDGE_ENTRY, file] };
|
|
321
|
+
}
|
|
322
|
+
/** A repairable protocol omission, distinct from invalid artifacts or failed verification. */
|
|
323
|
+
export class OpenSpecParticipationError extends Error {
|
|
324
|
+
}
|
|
325
|
+
export function openSpecRepairPrompt(context) {
|
|
326
|
+
return `The previous ${context.role} result cannot be accepted because you omitted the required official OpenSpec workflow. Do not merely resend the JSON. Continue this same role with the work already available. Load ${ROLE_SKILLS[context.role]} using the scoped workflow tool (action=load_skill), consult status and instructions ${context.role === 'architect' ? 'tasks' : 'apply'}, and execute the complete returned skill procedure against the current artifacts and code. Reconcile your previous conclusions with that procedure; correct your report if necessary. Do not rerun the implementation or the host verification commands. ${context.role === 'reviewer' ? 'Stay read-only; do not modify code or artifacts.' : 'Keep already-correct work and respect the same frozen scope.'} Finish with the originally requested J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AC,CAAC,OAAO,6PAA6P,OAAO,CAAC,IAAI,KAAK,UAAU,CAAC,CAAC,CAAC,kDAAkD,CAAC,CAAC,CAAC,8DAA8D;CAC3wB,CAAA;AACD,CAAC"}
|
|
@@ -3,7 +3,7 @@ import type { PipelineContext, VerificationCommand } from '../installer/runtime/
|
|
|
3
3
|
import { type ReviewPolicy } from './graph/review-policy.js';
|
|
4
4
|
import type { DeveloperRecord } from './graph/state.js';
|
|
5
5
|
/** Bump whenever the wording changes: the version is part of the frozen run identity. */
|
|
6
|
-
export declare const ROLE_INSTRUCTIONS_VERSION = "
|
|
6
|
+
export declare const ROLE_INSTRUCTIONS_VERSION = "9";
|
|
7
7
|
export interface RoleFeedback {
|
|
8
8
|
verification?: unknown;
|
|
9
9
|
review?: unknown;
|
|
@@ -14,7 +14,12 @@ export interface FrozenCriterion {
|
|
|
14
14
|
criterionIndex: number;
|
|
15
15
|
requirement: string;
|
|
16
16
|
}
|
|
17
|
+
/** Roles with an editable definition: the three pipeline agents plus the FIXER stance the developer role takes on a correction round. */
|
|
18
|
+
export type PromptRole = AgentRole | 'fixer';
|
|
17
19
|
export interface RoleInstructionOptions {
|
|
20
|
+
definition?: string;
|
|
21
|
+
/** `fixer`: the developer invocation is a correction round on the fixer stance (own definition, no plan dump). */
|
|
22
|
+
stance?: 'fixer';
|
|
18
23
|
feedback?: RoleFeedback;
|
|
19
24
|
verification?: VerificationCommand[];
|
|
20
25
|
/** Answers the requester gave to earlier architect questions, oldest first. */
|
|
@@ -25,10 +30,28 @@ export interface RoleInstructionOptions {
|
|
|
25
30
|
criteria?: FrozenCriterion[];
|
|
26
31
|
/** The developer's own account of the change, shown to the reviewer as a claim to verify. */
|
|
27
32
|
developer?: DeveloperRecord | null;
|
|
33
|
+
/** A reviewer pass after a correction round: only these files changed since its previous verdict, and these criteria it already certified as met. */
|
|
34
|
+
reReview?: ReReviewContext;
|
|
35
|
+
planning?: 'full' | 'proportional';
|
|
28
36
|
}
|
|
29
37
|
export declare const ARCHITECT_OUTPUT_SCHEMA: Record<string, unknown>;
|
|
30
38
|
export declare const DEVELOPER_OUTPUT_SCHEMA: Record<string, unknown>;
|
|
31
39
|
export declare const REVIEW_OUTPUT_SCHEMA: Record<string, unknown>;
|
|
40
|
+
/** Actual editable task definitions; dynamic scope and output contracts are assembled separately. */
|
|
41
|
+
export declare function rolePromptDefaults(): Record<PromptRole, string>;
|
|
42
|
+
export interface ReReviewContext {
|
|
43
|
+
changes: Array<{
|
|
44
|
+
repositoryId: string;
|
|
45
|
+
path: string;
|
|
46
|
+
status: 'added' | 'changed' | 'deleted';
|
|
47
|
+
}>;
|
|
48
|
+
previouslyMet: Array<{
|
|
49
|
+
specId: string;
|
|
50
|
+
criterionIndex: number;
|
|
51
|
+
}>;
|
|
52
|
+
}
|
|
53
|
+
/** Machine-readable line the compact reviewer parses back out of the prompt (see prompt-inputs.ts). */
|
|
54
|
+
export declare const RE_REVIEW_MARKER = "Re-review changes (JSON):";
|
|
32
55
|
/** Central role instructions. Roles describe their own work only: traversal,
|
|
33
56
|
* retries, checks, approvals, archive and delivery belong to the host. */
|
|
34
57
|
export declare function roleInstructions(role: AgentRole, context: PipelineContext, change: string, options?: RoleInstructionOptions): string;
|