@abelxiaoxing/cadence 2.0.20 → 2.0.21
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.de.md +24 -8
- package/README.es.md +24 -8
- package/README.fr.md +24 -8
- package/README.ja.md +27 -12
- package/README.ko.md +25 -12
- package/README.md +30 -13
- package/README.pt-BR.md +24 -8
- package/README.ru.md +24 -8
- package/README.zh-CN.md +33 -15
- package/docs/conversation-mode.md +104 -0
- package/docs/service-management.md +6 -4
- package/package.json +8 -3
- package/src/cadence-instructions.ts +7 -0
- package/src/cadence-mode.ts +794 -0
- package/src/cadence-preferences.ts +43 -0
- package/src/coordinator-tools.mjs +109 -0
- package/src/index.ts +2 -0
- package/src/native-build.ts +1 -1
- package/src/sdk-worker.mjs +28 -8
- package/src/service/contracts/workbench.ts +260 -2
- package/src/service/contracts/workflow.ts +465 -0
- package/src/service/coordination.ts +2 -0
- package/src/service-cli.mjs +3 -1
- package/src/service-host.mjs +2381 -222
- package/src/startup-card.ts +1 -1
- package/src/task-shell.ts +5 -4
- package/web/dist/assets/cadence.css +1 -1
- package/web/dist/assets/cadence.js +19 -13
- package/web/dist/manifest.json +7 -7
|
@@ -0,0 +1,465 @@
|
|
|
1
|
+
/** Conversation workflow DTOs. Plans are data; only fresh user confirmation admits execution. */
|
|
2
|
+
import {
|
|
3
|
+
bool,
|
|
4
|
+
canonicalJson,
|
|
5
|
+
closed,
|
|
6
|
+
decodeHash,
|
|
7
|
+
decodeId,
|
|
8
|
+
integer,
|
|
9
|
+
list,
|
|
10
|
+
nullable,
|
|
11
|
+
oneOf,
|
|
12
|
+
text,
|
|
13
|
+
} from "./core.ts";
|
|
14
|
+
import { type ChoiceVersion, decodeChoiceVersion } from "./models.ts";
|
|
15
|
+
|
|
16
|
+
export const WORKFLOW_LIMITS = {
|
|
17
|
+
tasks: 16,
|
|
18
|
+
parallel: 2,
|
|
19
|
+
checks: 16,
|
|
20
|
+
repairs: 2,
|
|
21
|
+
bytes: 256 * 1024,
|
|
22
|
+
runs: 200,
|
|
23
|
+
durationMs: 90 * 60 * 1000,
|
|
24
|
+
} as const;
|
|
25
|
+
export interface WorkflowCheck {
|
|
26
|
+
name: string;
|
|
27
|
+
command: string;
|
|
28
|
+
timeoutMs: number;
|
|
29
|
+
}
|
|
30
|
+
export interface WorkflowTask {
|
|
31
|
+
id: string;
|
|
32
|
+
title: string;
|
|
33
|
+
instructions: string;
|
|
34
|
+
writes: string[];
|
|
35
|
+
after: string[];
|
|
36
|
+
}
|
|
37
|
+
export interface WorkflowPlan {
|
|
38
|
+
goal: string;
|
|
39
|
+
design: string;
|
|
40
|
+
decisions: string;
|
|
41
|
+
acceptance: string;
|
|
42
|
+
projectContext: string;
|
|
43
|
+
tasks: WorkflowTask[];
|
|
44
|
+
checks: WorkflowCheck[];
|
|
45
|
+
setup: WorkflowCheck[];
|
|
46
|
+
baselineChecks: WorkflowCheck[];
|
|
47
|
+
repairAttempts: number;
|
|
48
|
+
delivery: "local-merge" | "working-copy";
|
|
49
|
+
}
|
|
50
|
+
export interface WorkflowProposal {
|
|
51
|
+
id: string;
|
|
52
|
+
epoch: string;
|
|
53
|
+
digest: string;
|
|
54
|
+
observation: string;
|
|
55
|
+
model: ChoiceVersion;
|
|
56
|
+
plan: WorkflowPlan;
|
|
57
|
+
cwd: string;
|
|
58
|
+
display?: { model: string; branch: string; baseCommit: string };
|
|
59
|
+
}
|
|
60
|
+
export interface WorkflowStep {
|
|
61
|
+
id: string;
|
|
62
|
+
childRunId?: string;
|
|
63
|
+
kind: "research" | "implementation" | "review" | "check" | "git";
|
|
64
|
+
status:
|
|
65
|
+
| "running"
|
|
66
|
+
| "completed"
|
|
67
|
+
| "failed"
|
|
68
|
+
| "canceled"
|
|
69
|
+
| "timeout"
|
|
70
|
+
| "unknown";
|
|
71
|
+
text: string;
|
|
72
|
+
exitCode: number | null;
|
|
73
|
+
truncated: boolean;
|
|
74
|
+
}
|
|
75
|
+
export interface WorkflowRun {
|
|
76
|
+
id: string;
|
|
77
|
+
epoch: string;
|
|
78
|
+
goal: string;
|
|
79
|
+
status:
|
|
80
|
+
| "queued"
|
|
81
|
+
| "running"
|
|
82
|
+
| "completed"
|
|
83
|
+
| "failed"
|
|
84
|
+
| "canceled"
|
|
85
|
+
| "timeout"
|
|
86
|
+
| "unknown";
|
|
87
|
+
phase:
|
|
88
|
+
| "research"
|
|
89
|
+
| "implementing"
|
|
90
|
+
| "verifying"
|
|
91
|
+
| "reviewing"
|
|
92
|
+
| "integrating"
|
|
93
|
+
| "finished";
|
|
94
|
+
steps: WorkflowStep[];
|
|
95
|
+
notice: string;
|
|
96
|
+
mergedCommit: string | null;
|
|
97
|
+
humanReviewed: false;
|
|
98
|
+
}
|
|
99
|
+
export type WorkflowRequest =
|
|
100
|
+
| {
|
|
101
|
+
action: "research";
|
|
102
|
+
goal: string;
|
|
103
|
+
questions: string[];
|
|
104
|
+
model: ChoiceVersion;
|
|
105
|
+
}
|
|
106
|
+
| { action: "propose"; plan: WorkflowPlan; model: ChoiceVersion }
|
|
107
|
+
| { action: "prepare"; proposalId: string; digest: string }
|
|
108
|
+
| { action: "execute"; proposalId: string; digest: string; grant: string }
|
|
109
|
+
| { action: "cancel"; runId: string };
|
|
110
|
+
export type WorkflowResponse =
|
|
111
|
+
| { type: "proposal"; proposal: WorkflowProposal }
|
|
112
|
+
| {
|
|
113
|
+
type: "grant";
|
|
114
|
+
proposal: WorkflowProposal;
|
|
115
|
+
grant: string;
|
|
116
|
+
expiresAt: number;
|
|
117
|
+
}
|
|
118
|
+
| { type: "run"; run: WorkflowRun };
|
|
119
|
+
|
|
120
|
+
export function workflowPath(v: unknown): string {
|
|
121
|
+
const p = text(v, 1024, true);
|
|
122
|
+
if (
|
|
123
|
+
p.startsWith("/") ||
|
|
124
|
+
p.includes("\\") ||
|
|
125
|
+
[...p].some(
|
|
126
|
+
(c) => c.charCodeAt(0) < 32 || c.charCodeAt(0) === 127 || c === ":",
|
|
127
|
+
) ||
|
|
128
|
+
p
|
|
129
|
+
.split("/")
|
|
130
|
+
.some(
|
|
131
|
+
(s) => !s || s === "." || s === ".." || s.toLowerCase() === ".git",
|
|
132
|
+
) ||
|
|
133
|
+
/(^|\/)\.env(?:\.|$)/iu.test(p)
|
|
134
|
+
)
|
|
135
|
+
throw new Error("Invalid workflow file path");
|
|
136
|
+
return p;
|
|
137
|
+
}
|
|
138
|
+
const taskId = (v: unknown) => {
|
|
139
|
+
const s = text(v, 64, true);
|
|
140
|
+
if (!/^[a-z][a-z0-9-]*$/u.test(s)) throw new Error("Invalid task id");
|
|
141
|
+
return s;
|
|
142
|
+
};
|
|
143
|
+
export function decodeWorkflowCheck(v: unknown): WorkflowCheck {
|
|
144
|
+
const o = closed(v, ["name", "command", "timeoutMs"]);
|
|
145
|
+
return {
|
|
146
|
+
name: text(o.name, 128, true),
|
|
147
|
+
command: text(o.command, 4096, true),
|
|
148
|
+
timeoutMs: integer(o.timeoutMs, 100, 1_200_000),
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
export function workflowOrder(tasks: WorkflowTask[]): WorkflowTask[] {
|
|
152
|
+
const done = new Set<string>(),
|
|
153
|
+
ordered: WorkflowTask[] = [];
|
|
154
|
+
if (new Set(tasks.map((t) => t.id)).size !== tasks.length)
|
|
155
|
+
throw new Error("Duplicate task id");
|
|
156
|
+
while (ordered.length < tasks.length) {
|
|
157
|
+
const next = tasks.find(
|
|
158
|
+
(t) => !done.has(t.id) && t.after.every((id) => done.has(id)),
|
|
159
|
+
);
|
|
160
|
+
if (!next) throw new Error("Missing dependency or cyclic plan");
|
|
161
|
+
ordered.push(next);
|
|
162
|
+
done.add(next.id);
|
|
163
|
+
}
|
|
164
|
+
return ordered;
|
|
165
|
+
}
|
|
166
|
+
export function workflowAncestors(
|
|
167
|
+
tasks: WorkflowTask[],
|
|
168
|
+
id: string,
|
|
169
|
+
): WorkflowTask[] {
|
|
170
|
+
const needed = new Set<string>();
|
|
171
|
+
const visit = (key: string) => {
|
|
172
|
+
for (const dep of tasks.find((t) => t.id === key)?.after ?? []) {
|
|
173
|
+
if (!needed.has(dep)) {
|
|
174
|
+
needed.add(dep);
|
|
175
|
+
visit(dep);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
workflowOrder(tasks);
|
|
180
|
+
visit(id);
|
|
181
|
+
return workflowOrder(tasks).filter((t) => needed.has(t.id));
|
|
182
|
+
}
|
|
183
|
+
export function decodeWorkflowPlan(v: unknown): WorkflowPlan {
|
|
184
|
+
canonicalJson(v, WORKFLOW_LIMITS.bytes);
|
|
185
|
+
const o = closed(v, [
|
|
186
|
+
"goal",
|
|
187
|
+
"design",
|
|
188
|
+
"decisions",
|
|
189
|
+
"acceptance",
|
|
190
|
+
"projectContext",
|
|
191
|
+
"tasks",
|
|
192
|
+
"checks",
|
|
193
|
+
"setup",
|
|
194
|
+
"baselineChecks",
|
|
195
|
+
"repairAttempts",
|
|
196
|
+
"delivery",
|
|
197
|
+
]);
|
|
198
|
+
const tasks = list(o.tasks, WORKFLOW_LIMITS.tasks, (value) => {
|
|
199
|
+
const t = closed(value, ["id", "title", "instructions", "writes", "after"]);
|
|
200
|
+
return {
|
|
201
|
+
id: taskId(t.id),
|
|
202
|
+
title: text(t.title, 256, true),
|
|
203
|
+
instructions: text(t.instructions, 8192, true),
|
|
204
|
+
writes: list(t.writes, 128, workflowPath),
|
|
205
|
+
after: list(t.after, WORKFLOW_LIMITS.tasks, taskId),
|
|
206
|
+
};
|
|
207
|
+
});
|
|
208
|
+
if (
|
|
209
|
+
!tasks.length ||
|
|
210
|
+
tasks.some(
|
|
211
|
+
(t) =>
|
|
212
|
+
!t.writes.length ||
|
|
213
|
+
new Set(t.writes).size !== t.writes.length ||
|
|
214
|
+
new Set(t.after).size !== t.after.length,
|
|
215
|
+
)
|
|
216
|
+
)
|
|
217
|
+
throw new Error("Empty or duplicate task scope");
|
|
218
|
+
workflowOrder(tasks);
|
|
219
|
+
for (const a of tasks)
|
|
220
|
+
for (const b of tasks) {
|
|
221
|
+
if (
|
|
222
|
+
a.id >= b.id ||
|
|
223
|
+
workflowAncestors(tasks, a.id).some((t) => t.id === b.id) ||
|
|
224
|
+
workflowAncestors(tasks, b.id).some((t) => t.id === a.id)
|
|
225
|
+
)
|
|
226
|
+
continue;
|
|
227
|
+
if (
|
|
228
|
+
a.writes.some((p) =>
|
|
229
|
+
b.writes.some(
|
|
230
|
+
(q) => p === q || p.startsWith(`${q}/`) || q.startsWith(`${p}/`),
|
|
231
|
+
),
|
|
232
|
+
)
|
|
233
|
+
)
|
|
234
|
+
throw new Error(
|
|
235
|
+
"Independent tasks share write paths; assign an owner and dependency",
|
|
236
|
+
);
|
|
237
|
+
}
|
|
238
|
+
const checks = list(o.checks, WORKFLOW_LIMITS.checks, decodeWorkflowCheck);
|
|
239
|
+
if (!checks.length)
|
|
240
|
+
throw new Error("At least one real verification command is required");
|
|
241
|
+
const result: WorkflowPlan = {
|
|
242
|
+
goal: text(o.goal, 8192, true),
|
|
243
|
+
design: text(o.design, 32768, true),
|
|
244
|
+
decisions: text(o.decisions, 16384),
|
|
245
|
+
acceptance: text(o.acceptance, 16384, true),
|
|
246
|
+
projectContext: text(o.projectContext, 16384),
|
|
247
|
+
tasks,
|
|
248
|
+
checks,
|
|
249
|
+
setup: list(o.setup, 4, decodeWorkflowCheck),
|
|
250
|
+
baselineChecks: list(
|
|
251
|
+
o.baselineChecks,
|
|
252
|
+
WORKFLOW_LIMITS.checks,
|
|
253
|
+
decodeWorkflowCheck,
|
|
254
|
+
),
|
|
255
|
+
repairAttempts: integer(o.repairAttempts, 0, WORKFLOW_LIMITS.repairs),
|
|
256
|
+
delivery: oneOf(o.delivery, ["local-merge", "working-copy"]),
|
|
257
|
+
};
|
|
258
|
+
workflowContext(result);
|
|
259
|
+
text(result.tasks.flatMap((t) => t.writes).join(", "), 16384);
|
|
260
|
+
for (const value of [
|
|
261
|
+
result.goal,
|
|
262
|
+
result.design,
|
|
263
|
+
result.decisions,
|
|
264
|
+
result.acceptance,
|
|
265
|
+
result.projectContext,
|
|
266
|
+
...result.tasks.flatMap((t) => [t.title, t.instructions]),
|
|
267
|
+
...[...result.checks, ...result.setup, ...result.baselineChecks].flatMap(
|
|
268
|
+
(c) => [c.name, c.command],
|
|
269
|
+
),
|
|
270
|
+
])
|
|
271
|
+
if (
|
|
272
|
+
[...value].some(
|
|
273
|
+
(c) =>
|
|
274
|
+
(c.charCodeAt(0) < 32 && c !== "\n" && c !== "\t") ||
|
|
275
|
+
c.charCodeAt(0) === 127 ||
|
|
276
|
+
/[\u202a-\u202e\u2066-\u2069]/u.test(c),
|
|
277
|
+
)
|
|
278
|
+
)
|
|
279
|
+
throw new Error("Plan contains invisible terminal controls");
|
|
280
|
+
return result;
|
|
281
|
+
}
|
|
282
|
+
export function workflowContext(p: WorkflowPlan): string {
|
|
283
|
+
return text(
|
|
284
|
+
`# ${p.goal}\n\n${p.design}\n\nDecisions: ${p.decisions}\n\nAcceptance: ${p.acceptance}`,
|
|
285
|
+
32768,
|
|
286
|
+
true,
|
|
287
|
+
);
|
|
288
|
+
}
|
|
289
|
+
export function decodeWorkflowProposal(v: unknown): WorkflowProposal {
|
|
290
|
+
const modern =
|
|
291
|
+
v !== null && typeof v === "object" && Object.hasOwn(v, "display");
|
|
292
|
+
const o = closed(v, [
|
|
293
|
+
"id",
|
|
294
|
+
"epoch",
|
|
295
|
+
"digest",
|
|
296
|
+
"observation",
|
|
297
|
+
"model",
|
|
298
|
+
"plan",
|
|
299
|
+
"cwd",
|
|
300
|
+
...(modern ? ["display"] : []),
|
|
301
|
+
]);
|
|
302
|
+
return {
|
|
303
|
+
id: decodeId(o.id),
|
|
304
|
+
epoch: decodeId(o.epoch),
|
|
305
|
+
digest: decodeHash(o.digest),
|
|
306
|
+
observation: decodeHash(o.observation),
|
|
307
|
+
model: decodeChoiceVersion(o.model),
|
|
308
|
+
plan: decodeWorkflowPlan(o.plan),
|
|
309
|
+
cwd: text(o.cwd, 4096, true),
|
|
310
|
+
...(modern
|
|
311
|
+
? {
|
|
312
|
+
display: (() => {
|
|
313
|
+
const d = closed(o.display, ["model", "branch", "baseCommit"]);
|
|
314
|
+
return {
|
|
315
|
+
model: text(d.model, 1024, true),
|
|
316
|
+
branch: text(d.branch, 1024),
|
|
317
|
+
baseCommit: text(d.baseCommit, 64),
|
|
318
|
+
};
|
|
319
|
+
})(),
|
|
320
|
+
}
|
|
321
|
+
: {}),
|
|
322
|
+
};
|
|
323
|
+
}
|
|
324
|
+
export function decodeWorkflowRequest(v: unknown): WorkflowRequest {
|
|
325
|
+
const action = Object.getOwnPropertyDescriptor(v ?? {}, "action")?.value;
|
|
326
|
+
if (action === "research") {
|
|
327
|
+
const o = closed(v, ["action", "goal", "questions", "model"]);
|
|
328
|
+
const questions = list(o.questions, WORKFLOW_LIMITS.parallel, (q) =>
|
|
329
|
+
text(q, 8192, true),
|
|
330
|
+
);
|
|
331
|
+
if (!questions.length) throw new Error("Research needs a question");
|
|
332
|
+
return {
|
|
333
|
+
action,
|
|
334
|
+
goal: text(o.goal, 8192, true),
|
|
335
|
+
questions,
|
|
336
|
+
model: decodeChoiceVersion(o.model),
|
|
337
|
+
};
|
|
338
|
+
}
|
|
339
|
+
if (action === "propose") {
|
|
340
|
+
const o = closed(v, ["action", "plan", "model"]);
|
|
341
|
+
return {
|
|
342
|
+
action,
|
|
343
|
+
plan: decodeWorkflowPlan(o.plan),
|
|
344
|
+
model: decodeChoiceVersion(o.model),
|
|
345
|
+
};
|
|
346
|
+
}
|
|
347
|
+
if (action === "prepare" || action === "execute") {
|
|
348
|
+
const o = closed(
|
|
349
|
+
v,
|
|
350
|
+
action === "execute"
|
|
351
|
+
? ["action", "proposalId", "digest", "grant"]
|
|
352
|
+
: ["action", "proposalId", "digest"],
|
|
353
|
+
);
|
|
354
|
+
const base = {
|
|
355
|
+
proposalId: decodeId(o.proposalId),
|
|
356
|
+
digest: decodeHash(o.digest),
|
|
357
|
+
};
|
|
358
|
+
return action === "prepare"
|
|
359
|
+
? { action, ...base }
|
|
360
|
+
: { action, ...base, grant: decodeId(o.grant) };
|
|
361
|
+
}
|
|
362
|
+
const o = closed(v, ["action", "runId"]);
|
|
363
|
+
return { action: oneOf(o.action, ["cancel"]), runId: decodeId(o.runId) };
|
|
364
|
+
}
|
|
365
|
+
export function decodeWorkflowRun(v: unknown): WorkflowRun {
|
|
366
|
+
const o = closed(v, [
|
|
367
|
+
"id",
|
|
368
|
+
"epoch",
|
|
369
|
+
"goal",
|
|
370
|
+
"status",
|
|
371
|
+
"phase",
|
|
372
|
+
"steps",
|
|
373
|
+
"notice",
|
|
374
|
+
"mergedCommit",
|
|
375
|
+
"humanReviewed",
|
|
376
|
+
]);
|
|
377
|
+
const status = (x: unknown) =>
|
|
378
|
+
oneOf(x, [
|
|
379
|
+
"running",
|
|
380
|
+
"completed",
|
|
381
|
+
"failed",
|
|
382
|
+
"canceled",
|
|
383
|
+
"timeout",
|
|
384
|
+
"unknown",
|
|
385
|
+
] as const);
|
|
386
|
+
if (o.humanReviewed !== false)
|
|
387
|
+
throw new Error("Automatic execution is not human review");
|
|
388
|
+
return {
|
|
389
|
+
id: decodeId(o.id),
|
|
390
|
+
epoch: decodeId(o.epoch),
|
|
391
|
+
goal: text(o.goal, 8192),
|
|
392
|
+
status: o.status === "queued" ? "queued" : status(o.status),
|
|
393
|
+
phase: oneOf(o.phase, [
|
|
394
|
+
"research",
|
|
395
|
+
"implementing",
|
|
396
|
+
"verifying",
|
|
397
|
+
"reviewing",
|
|
398
|
+
"integrating",
|
|
399
|
+
"finished",
|
|
400
|
+
]),
|
|
401
|
+
notice: text(o.notice, 2048),
|
|
402
|
+
mergedCommit: nullable(o.mergedCommit, (s) => text(s, 64, true)),
|
|
403
|
+
humanReviewed: false,
|
|
404
|
+
steps: list(o.steps, 256, (v) => {
|
|
405
|
+
const linked =
|
|
406
|
+
v !== null && typeof v === "object" && Object.hasOwn(v, "childRunId");
|
|
407
|
+
const s = closed(v, [
|
|
408
|
+
"id",
|
|
409
|
+
"kind",
|
|
410
|
+
"status",
|
|
411
|
+
"text",
|
|
412
|
+
"exitCode",
|
|
413
|
+
"truncated",
|
|
414
|
+
...(linked ? ["childRunId"] : []),
|
|
415
|
+
]);
|
|
416
|
+
return {
|
|
417
|
+
id: text(s.id, 160, true),
|
|
418
|
+
...(linked ? { childRunId: decodeId(s.childRunId) } : {}),
|
|
419
|
+
kind: oneOf(s.kind, [
|
|
420
|
+
"research",
|
|
421
|
+
"implementation",
|
|
422
|
+
"review",
|
|
423
|
+
"check",
|
|
424
|
+
"git",
|
|
425
|
+
]),
|
|
426
|
+
status: status(s.status),
|
|
427
|
+
text: text(s.text, 65536),
|
|
428
|
+
exitCode: nullable(s.exitCode, (n) =>
|
|
429
|
+
integer(n, -2147483648, 2147483647),
|
|
430
|
+
),
|
|
431
|
+
truncated: bool(s.truncated),
|
|
432
|
+
};
|
|
433
|
+
}),
|
|
434
|
+
};
|
|
435
|
+
}
|
|
436
|
+
export function decodeWorkflowResponse(v: unknown): WorkflowResponse {
|
|
437
|
+
const type = Object.getOwnPropertyDescriptor(v ?? {}, "type")?.value;
|
|
438
|
+
if (type === "run") {
|
|
439
|
+
const o = closed(v, ["type", "run"]);
|
|
440
|
+
return { type, run: decodeWorkflowRun(o.run) };
|
|
441
|
+
}
|
|
442
|
+
if (type === "proposal") {
|
|
443
|
+
const o = closed(v, ["type", "proposal"]);
|
|
444
|
+
return { type, proposal: decodeWorkflowProposal(o.proposal) };
|
|
445
|
+
}
|
|
446
|
+
const o = closed(v, ["type", "proposal", "grant", "expiresAt"]);
|
|
447
|
+
return {
|
|
448
|
+
type: oneOf(o.type, ["grant"]),
|
|
449
|
+
proposal: decodeWorkflowProposal(o.proposal),
|
|
450
|
+
grant: decodeId(o.grant),
|
|
451
|
+
expiresAt: integer(o.expiresAt, 0),
|
|
452
|
+
};
|
|
453
|
+
}
|
|
454
|
+
export function readableWorkflowPlan(p: WorkflowPlan): string {
|
|
455
|
+
return `# ${p.goal}\n\n## Design\n${p.design}\n\n## Decisions\n${p.decisions}\n\n## Acceptance\n${p.acceptance}\n\n## Tasks\n${workflowOrder(
|
|
456
|
+
p.tasks,
|
|
457
|
+
)
|
|
458
|
+
.map(
|
|
459
|
+
(t) =>
|
|
460
|
+
`### ${t.id}: ${t.title}\nDepends on: ${t.after.join(", ") || "none"}\nWrites: ${t.writes.join(", ")}\n${t.instructions}`,
|
|
461
|
+
)
|
|
462
|
+
.join(
|
|
463
|
+
"\n\n",
|
|
464
|
+
)}\n\n## Setup (explicitly authorized commands)\n${p.setup.map((c) => `${c.name}: ${c.command} (${c.timeoutMs}ms)`).join("\n") || "None; no dependency installation or copying."}\n\n## Baseline verification\n${p.baselineChecks.map((c) => `${c.name}: ${c.command} (${c.timeoutMs}ms)`).join("\n") || "No separate baseline checks declared."}\n\n## Verification\n${p.checks.map((c) => `${c.name}: ${c.command} (${c.timeoutMs}ms)`).join("\n")}\n\n## Automation boundary\nAt most ${p.repairAttempts} repair rounds. ${p.delivery === "local-merge" ? "Authorize isolated task worktrees, local task commits and fast-forward integration into the current branch." : "Direct working-copy edits; failures leave actual edits for inspection. No Git commit or merge."} No push, publication, deployment, unplanned installation or recursive delegation. Generated project context and workflow Markdown are included. Worktrees/tools are not a sandbox.\n\n## Project context\n${p.projectContext}\n`;
|
|
465
|
+
}
|
package/src/service-cli.mjs
CHANGED
|
@@ -3629,7 +3629,9 @@ class ServiceCoordination {
|
|
|
3629
3629
|
"access.json",
|
|
3630
3630
|
"host-config.json",
|
|
3631
3631
|
"history-v2",
|
|
3632
|
-
"conversations-v1"
|
|
3632
|
+
"conversations-v1",
|
|
3633
|
+
"conversation-workflows-v1",
|
|
3634
|
+
"workflows-v1"
|
|
3633
3635
|
]);
|
|
3634
3636
|
this.files.directory(join5(directory2, "history-v2"), false, walks);
|
|
3635
3637
|
}
|