@ronkovic/aad 0.4.0 β 0.5.1
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 +42 -4
- package/package.json +1 -1
- package/src/__tests__/e2e/cleanup-e2e.test.ts +186 -0
- package/src/__tests__/e2e/dashboard-api-e2e.test.ts +87 -0
- package/src/__tests__/e2e/pipeline-e2e.test.ts +10 -69
- package/src/__tests__/e2e/resume-e2e.test.ts +7 -11
- package/src/__tests__/e2e/retry-e2e.test.ts +285 -0
- package/src/__tests__/e2e/status-e2e.test.ts +227 -0
- package/src/__tests__/e2e/tdd-pipeline-e2e.test.ts +360 -0
- package/src/__tests__/helpers/index.ts +6 -0
- package/src/__tests__/helpers/mock-claude-provider.ts +53 -0
- package/src/__tests__/helpers/mock-logger.ts +36 -0
- package/src/__tests__/helpers/wait-helpers.ts +34 -0
- package/src/__tests__/integration/pipeline.test.ts +2 -0
- package/src/modules/claude-provider/__tests__/claude-sdk.adapter.test.ts +79 -0
- package/src/modules/claude-provider/__tests__/provider-registry.test.ts +2 -0
- package/src/modules/cli/__tests__/cleanup.test.ts +1 -0
- package/src/modules/cli/__tests__/resume.test.ts +3 -0
- package/src/modules/cli/__tests__/run.test.ts +36 -0
- package/src/modules/cli/__tests__/status.test.ts +1 -0
- package/src/modules/cli/app.ts +2 -0
- package/src/modules/cli/commands/resume.ts +11 -6
- package/src/modules/cli/commands/run.ts +14 -2
- package/src/modules/dashboard/ui/dashboard.html +640 -474
- package/src/modules/planning/__tests__/planning-service.test.ts +2 -0
- package/src/modules/process-manager/__tests__/process-manager.test.ts +2 -0
- package/src/modules/process-manager/process-manager.ts +2 -1
- package/src/modules/task-execution/__tests__/executor.test.ts +420 -10
- package/src/modules/task-execution/executor.ts +76 -0
- package/src/modules/task-queue/dispatcher.ts +46 -2
- package/src/shared/__tests__/config.test.ts +30 -0
- package/src/shared/__tests__/events.test.ts +42 -16
- package/src/shared/__tests__/shutdown-handler.test.ts +96 -0
- package/src/shared/config.ts +4 -0
- package/src/shared/events.ts +5 -0
- package/src/shared/memory-check.ts +2 -2
- package/src/shared/shutdown-handler.ts +12 -5
- package/src/shared/types.ts +12 -0
- package/src/modules/claude-provider/__tests__/claude-sdk-real-env.test.ts +0 -127
package/src/modules/cli/app.ts
CHANGED
|
@@ -50,6 +50,7 @@ export interface App {
|
|
|
50
50
|
mergeService: MergeService;
|
|
51
51
|
dashboardServer?: DashboardServer;
|
|
52
52
|
pluginManager: PluginManager;
|
|
53
|
+
persistMode: "memory" | "fs";
|
|
53
54
|
shutdown(): Promise<void>;
|
|
54
55
|
}
|
|
55
56
|
|
|
@@ -240,6 +241,7 @@ export function createApp(options: AppOptions = {}): App {
|
|
|
240
241
|
mergeService,
|
|
241
242
|
dashboardServer,
|
|
242
243
|
pluginManager,
|
|
244
|
+
persistMode,
|
|
243
245
|
shutdown,
|
|
244
246
|
};
|
|
245
247
|
}
|
|
@@ -35,7 +35,11 @@ export async function resumeRun(app: App, runIdStr: string): Promise<void> {
|
|
|
35
35
|
const runId = createRunId(runIdStr);
|
|
36
36
|
|
|
37
37
|
logger.info({ runId }, "Resuming run");
|
|
38
|
-
console.log(`\nπ Resuming Run: ${runId}
|
|
38
|
+
console.log(`\nπ Resuming Run: ${runId}`);
|
|
39
|
+
if (app.dashboardServer) {
|
|
40
|
+
console.log(`π Dashboard: http://${app.config.dashboard.host}:${app.config.dashboard.port}`);
|
|
41
|
+
}
|
|
42
|
+
console.log();
|
|
39
43
|
|
|
40
44
|
// 1. RunStateγθͺγΏθΎΌγΏ
|
|
41
45
|
const runState = await stores.runStore.get(runId);
|
|
@@ -122,6 +126,7 @@ export async function resumeRun(app: App, runIdStr: string): Promise<void> {
|
|
|
122
126
|
runId,
|
|
123
127
|
stores: { runStore: stores.runStore, taskStore: stores.taskStore },
|
|
124
128
|
logger,
|
|
129
|
+
persistMode: app.persistMode,
|
|
125
130
|
});
|
|
126
131
|
// Check if parent worktree exists from a previous run
|
|
127
132
|
const parentWorktreePath = `${process.cwd()}/.aad/worktrees/parent-${runId}`;
|
|
@@ -159,30 +164,30 @@ export async function resumeRun(app: App, runIdStr: string): Promise<void> {
|
|
|
159
164
|
|
|
160
165
|
await new Promise<void>((resolve, reject) => {
|
|
161
166
|
let settled = false;
|
|
162
|
-
const settle = (fn: () => void) => {
|
|
167
|
+
const settle = (fn: () => void): void => {
|
|
163
168
|
if (settled) return;
|
|
164
169
|
settled = true;
|
|
165
170
|
cleanup();
|
|
166
171
|
fn();
|
|
167
172
|
};
|
|
168
173
|
|
|
169
|
-
const onCompleted = (event: { type: string; runId?: string }) => {
|
|
174
|
+
const onCompleted = (event: { type: string; runId?: string }): void => {
|
|
170
175
|
if (event.type === "run:completed" && event.runId === runId) {
|
|
171
176
|
settle(resolve);
|
|
172
177
|
}
|
|
173
178
|
};
|
|
174
179
|
|
|
175
|
-
const onFailed = (event: { type: string; runId?: string; error?: string }) => {
|
|
180
|
+
const onFailed = (event: { type: string; runId?: string; error?: string }): void => {
|
|
176
181
|
if (event.type === "run:failed" && event.runId === runId) {
|
|
177
182
|
settle(() => reject(new Error(`Run failed: ${event.error ?? "unknown error"}`)));
|
|
178
183
|
}
|
|
179
184
|
};
|
|
180
185
|
|
|
181
|
-
const timer = setTimeout(() => {
|
|
186
|
+
const timer = setTimeout((): void => {
|
|
182
187
|
settle(() => reject(new Error(`Resume timed out after ${timeoutMs}ms`)));
|
|
183
188
|
}, timeoutMs);
|
|
184
189
|
|
|
185
|
-
const cleanup = () => {
|
|
190
|
+
const cleanup = (): void => {
|
|
186
191
|
clearTimeout(timer);
|
|
187
192
|
app.eventBus.off("run:completed", onCompleted);
|
|
188
193
|
app.eventBus.off("run:failed", onFailed);
|
|
@@ -29,10 +29,17 @@ export function createRunCommand(getApp: () => App): Command {
|
|
|
29
29
|
.option("--plugins <paths>", "Comma-separated plugin paths to load")
|
|
30
30
|
.option("--keep-worktrees", "Keep worktrees and branches after completion (default: auto-cleanup)", false)
|
|
31
31
|
.option("--dry-run", "Display task plan without executing", false)
|
|
32
|
-
.
|
|
32
|
+
.option("--strict-tdd", "Always run full TDD pipeline (disable pre-check optimization)", false)
|
|
33
|
+
.action(async (requirementsPath: string, cmdOptions: { keepWorktrees?: boolean; dryRun?: boolean; strictTdd?: boolean }) => {
|
|
33
34
|
let app: App | null = null;
|
|
34
35
|
try {
|
|
35
36
|
app = getApp();
|
|
37
|
+
|
|
38
|
+
// Override config with CLI options
|
|
39
|
+
if (cmdOptions.strictTdd !== undefined) {
|
|
40
|
+
app.config.strictTdd = cmdOptions.strictTdd;
|
|
41
|
+
}
|
|
42
|
+
|
|
36
43
|
await runPipeline(app, requirementsPath, cmdOptions.keepWorktrees ?? false, cmdOptions.dryRun ?? false);
|
|
37
44
|
await app.shutdown();
|
|
38
45
|
process.exit(process.exitCode ?? 0);
|
|
@@ -86,7 +93,11 @@ export async function runPipeline(app: App, requirementsPath: string, keepWorktr
|
|
|
86
93
|
|
|
87
94
|
logger.info({ runId, parentBranch }, "Initialized run");
|
|
88
95
|
console.log(`\nπ AAD Run: ${runId}`);
|
|
89
|
-
console.log(`π Parent Branch: ${parentBranch}
|
|
96
|
+
console.log(`π Parent Branch: ${parentBranch}`);
|
|
97
|
+
if (app.dashboardServer) {
|
|
98
|
+
console.log(`π Dashboard: http://${config.dashboard.host}:${config.dashboard.port}`);
|
|
99
|
+
}
|
|
100
|
+
console.log();
|
|
90
101
|
|
|
91
102
|
// 2. PlanningService.planTasks() β TaskPlan
|
|
92
103
|
const planSpinner = createSpinner("Planning tasks...");
|
|
@@ -164,6 +175,7 @@ export async function runPipeline(app: App, requirementsPath: string, keepWorktr
|
|
|
164
175
|
runId,
|
|
165
176
|
stores: { runStore: stores.runStore, taskStore: stores.taskStore },
|
|
166
177
|
logger,
|
|
178
|
+
persistMode: app.persistMode,
|
|
167
179
|
});
|
|
168
180
|
|
|
169
181
|
// 5. Generate feature name and create parent worktree with real branch
|