@wrongstack/sdd 0.284.1 → 0.285.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/dist/auto-executor.d.ts +89 -0
- package/dist/auto-executor.d.ts.map +1 -0
- package/dist/board-types.d.ts +144 -0
- package/dist/board-types.d.ts.map +1 -0
- package/dist/conflict-resolver.d.ts +45 -0
- package/dist/conflict-resolver.d.ts.map +1 -0
- package/dist/critical-path.d.ts +36 -0
- package/dist/critical-path.d.ts.map +1 -0
- package/dist/decompose-task.d.ts +20 -0
- package/dist/decompose-task.d.ts.map +1 -0
- package/dist/index.d.ts +26 -1864
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +192 -76
- package/dist/index.js.map +7 -1
- package/dist/sdd-board-projector.d.ts +83 -0
- package/dist/sdd-board-projector.d.ts.map +1 -0
- package/dist/sdd-board-store.d.ts +59 -0
- package/dist/sdd-board-store.d.ts.map +1 -0
- package/dist/sdd-interview-driver.d.ts +131 -0
- package/dist/sdd-interview-driver.d.ts.map +1 -0
- package/dist/sdd-lifecycle.d.ts +146 -0
- package/dist/sdd-lifecycle.d.ts.map +1 -0
- package/dist/sdd-parallel-run.d.ts +427 -0
- package/dist/sdd-parallel-run.d.ts.map +1 -0
- package/dist/sdd-run-registry.d.ts +68 -0
- package/dist/sdd-run-registry.d.ts.map +1 -0
- package/dist/sdd-supervisor.d.ts +52 -0
- package/dist/sdd-supervisor.d.ts.map +1 -0
- package/dist/sdd-task-decomposer.d.ts +89 -0
- package/dist/sdd-task-decomposer.d.ts.map +1 -0
- package/dist/spec-builder.d.ts +139 -0
- package/dist/spec-builder.d.ts.map +1 -0
- package/dist/spec-parser.d.ts +14 -0
- package/dist/spec-parser.d.ts.map +1 -0
- package/dist/spec-store.d.ts +36 -0
- package/dist/spec-store.d.ts.map +1 -0
- package/dist/spec-templates.d.ts +22 -0
- package/dist/spec-templates.d.ts.map +1 -0
- package/dist/spec-versioning.d.ts +49 -0
- package/dist/spec-versioning.d.ts.map +1 -0
- package/dist/start-sdd-run.d.ts +67 -0
- package/dist/start-sdd-run.d.ts.map +1 -0
- package/dist/task-flow.d.ts +99 -0
- package/dist/task-flow.d.ts.map +1 -0
- package/dist/task-generator.d.ts +39 -0
- package/dist/task-generator.d.ts.map +1 -0
- package/dist/task-graph-store.d.ts +33 -0
- package/dist/task-graph-store.d.ts.map +1 -0
- package/dist/task-tracker.d.ts +2 -0
- package/dist/task-tracker.d.ts.map +1 -0
- package/dist/task-visualizer.d.ts +26 -0
- package/dist/task-visualizer.d.ts.map +1 -0
- package/dist/verify-task.d.ts +23 -0
- package/dist/verify-task.d.ts.map +1 -0
- package/package.json +4 -5
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import type { TaskGraph, TaskNode } from '@wrongstack/core/types';
|
|
2
|
+
import type { Specification } from '@wrongstack/core/types';
|
|
3
|
+
import type { EventBus } from '@wrongstack/core/kernel';
|
|
4
|
+
import type { TaskTracker } from '@wrongstack/core/tasking';
|
|
5
|
+
export interface AutoExecutorOptions {
|
|
6
|
+
tracker: TaskTracker;
|
|
7
|
+
events: EventBus;
|
|
8
|
+
/** Maximum concurrent tasks. Defaults to 1 (sequential). */
|
|
9
|
+
maxConcurrent?: number | undefined;
|
|
10
|
+
/** Maximum retry attempts for failed tasks. */
|
|
11
|
+
maxRetries?: number | undefined;
|
|
12
|
+
/** Custom task executor function. */
|
|
13
|
+
executeTask: (task: TaskNode, context: TaskExecutionContext) => Promise<TaskExecutionResult>;
|
|
14
|
+
/** Called before each task starts. */
|
|
15
|
+
onTaskStart?: (((task: TaskNode) => void)) | undefined;
|
|
16
|
+
/** Called after each task completes. */
|
|
17
|
+
onTaskComplete?: (task: TaskNode, result: TaskExecutionResult) => void;
|
|
18
|
+
/** Called when a task fails. */
|
|
19
|
+
onTaskFail?: (task: TaskNode, error: Error, retryCount: number) => void;
|
|
20
|
+
/** Called when all tasks are done or no more can execute. */
|
|
21
|
+
onDone?: (((summary: ExecutionSummary) => void)) | undefined;
|
|
22
|
+
}
|
|
23
|
+
export interface TaskExecutionContext {
|
|
24
|
+
/** The spec being implemented. */
|
|
25
|
+
spec: Specification;
|
|
26
|
+
/** The full task graph. */
|
|
27
|
+
graph: TaskGraph;
|
|
28
|
+
/** The current task being executed. */
|
|
29
|
+
task: TaskNode;
|
|
30
|
+
/** Tasks that this task depends on. */
|
|
31
|
+
dependencies: TaskNode[];
|
|
32
|
+
/** Tasks that depend on this task. */
|
|
33
|
+
dependents: TaskNode[];
|
|
34
|
+
/** Retry count for this task (0 = first attempt). */
|
|
35
|
+
retryCount: number;
|
|
36
|
+
}
|
|
37
|
+
export interface TaskExecutionResult {
|
|
38
|
+
success: boolean;
|
|
39
|
+
output?: string | undefined;
|
|
40
|
+
error?: string | undefined;
|
|
41
|
+
/** If true, the task will be retried. */
|
|
42
|
+
retry?: boolean | undefined;
|
|
43
|
+
}
|
|
44
|
+
export interface ExecutionSummary {
|
|
45
|
+
total: number;
|
|
46
|
+
completed: number;
|
|
47
|
+
failed: number;
|
|
48
|
+
skipped: number;
|
|
49
|
+
retried: number;
|
|
50
|
+
duration: number;
|
|
51
|
+
criticalPath: string[];
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Auto-executor that drives task execution with dependency resolution,
|
|
55
|
+
* retry logic, and critical path awareness.
|
|
56
|
+
*/
|
|
57
|
+
export declare class AutoExecutor {
|
|
58
|
+
private readonly opts;
|
|
59
|
+
private stopped;
|
|
60
|
+
private retryMap;
|
|
61
|
+
constructor(opts: AutoExecutorOptions);
|
|
62
|
+
/**
|
|
63
|
+
* Execute all tasks in the graph, respecting dependencies.
|
|
64
|
+
*/
|
|
65
|
+
execute(graph: TaskGraph, spec: Specification): Promise<ExecutionSummary>;
|
|
66
|
+
/** Stop execution. */
|
|
67
|
+
stop(): void;
|
|
68
|
+
/** Get tasks that are ready to execute (all dependencies completed). */
|
|
69
|
+
private getReadyTasks;
|
|
70
|
+
/** Execute a single task with retry logic. */
|
|
71
|
+
private executeTaskWithRetry;
|
|
72
|
+
/** Get tasks that this task depends on. */
|
|
73
|
+
private getTaskDependencies;
|
|
74
|
+
/** Get tasks that depend on this task. */
|
|
75
|
+
private getTaskDependents;
|
|
76
|
+
/** Detect deadlock: all remaining tasks are blocked by failed tasks. */
|
|
77
|
+
private detectDeadlock;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Create an auto-executor that works with TaskFlow.
|
|
81
|
+
*/
|
|
82
|
+
export declare function createAutoExecutor(opts: {
|
|
83
|
+
tracker: TaskTracker;
|
|
84
|
+
events: EventBus;
|
|
85
|
+
executeTask: AutoExecutorOptions['executeTask'];
|
|
86
|
+
maxConcurrent?: number | undefined;
|
|
87
|
+
maxRetries?: number | undefined;
|
|
88
|
+
}): AutoExecutor;
|
|
89
|
+
//# sourceMappingURL=auto-executor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auto-executor.d.ts","sourceRoot":"","sources":["../src/auto-executor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAG5D,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,WAAW,CAAC;IACrB,MAAM,EAAE,QAAQ,CAAC;IACjB,4DAA4D;IAC5D,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,+CAA+C;IAC/C,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,qCAAqC;IACrC,WAAW,EAAE,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,oBAAoB,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAAC;IA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YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAED;;;GAGG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAsB;IAC3C,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,QAAQ,CAA6B;IAE7C,YAAY,IAAI,EAAE,mBAAmB,EAEpC;IAED;;OAEG;IACG,OAAO,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,gBAAgB,CAAC,CA2E9E;IAED,sBAAsB;IACtB,IAAI,IAAI,IAAI,CAEX;IAED,wEAAwE;IACxE,OAAO,CAAC,aAAa;IAyBrB,8CAA8C;YAChC,oBAAoB;IA+DlC,2CAA2C;IAC3C,OAAO,CAAC,mBAAmB;IAO3B,0CAA0C;IAC1C,OAAO,CAAC,iBAAiB;IAOzB,wEAAwE;IACxE,OAAO,CAAC,cAAc;CAgBvB;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE;IACvC,OAAO,EAAE,WAAW,CAAC;IACrB,MAAM,EAAE,QAAQ,CAAC;IACjB,WAAW,EAAE,mBAAmB,CAAC,aAAa,CAAC,CAAC;IAChD,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACjC,GAAG,YAAY,CAQf"}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SDD live board model.
|
|
3
|
+
*
|
|
4
|
+
* A board snapshot is the canonical, surface-agnostic projection of a running
|
|
5
|
+
* (or persisted) SDD TaskGraph: tasks laid into topological dependency columns,
|
|
6
|
+
* each carrying its short id, status, blockers and the agent currently on it.
|
|
7
|
+
* The projector (sdd-board-projector.ts) emits these over the EventBus and
|
|
8
|
+
* persists them (sdd-board-store.ts); every surface (WebUI/TUI) renders the
|
|
9
|
+
* same shape.
|
|
10
|
+
*/
|
|
11
|
+
import type { TaskGraph, TaskNode, TaskProgress } from '@wrongstack/core/types';
|
|
12
|
+
export type SddBoardStatus = 'idle' | 'running' | 'paused' | 'stopped' | 'completed' | 'failed' | 'deadlocked';
|
|
13
|
+
/**
|
|
14
|
+
* FORGE-style display status: `queued` = pending with all blockers done;
|
|
15
|
+
* `cancelled` = a task the user stopped (stored as a terminal `failed` node
|
|
16
|
+
* carrying `metadata.cancelled`, surfaced distinctly so it doesn't read as an
|
|
17
|
+
* error). Display-only — not a core `TaskStatus`.
|
|
18
|
+
*/
|
|
19
|
+
export type SddTaskDisplayStatus = TaskNode['status'] | 'queued' | 'cancelled';
|
|
20
|
+
export interface SddBoardTask {
|
|
21
|
+
id: string;
|
|
22
|
+
/** Stable short id (t01, t02, …) in creation order. */
|
|
23
|
+
shortId: string;
|
|
24
|
+
title: string;
|
|
25
|
+
description: string;
|
|
26
|
+
status: TaskNode['status'];
|
|
27
|
+
displayStatus: SddTaskDisplayStatus;
|
|
28
|
+
priority: TaskNode['priority'];
|
|
29
|
+
type: TaskNode['type'];
|
|
30
|
+
/** Short ids of the tasks that block this one (depends_on edges). */
|
|
31
|
+
deps: string[];
|
|
32
|
+
/** Worker on the task right now (scientist nickname), if any. */
|
|
33
|
+
agentName?: string | undefined;
|
|
34
|
+
/** Git worktree branch this task runs in, when isolated. */
|
|
35
|
+
worktreeBranch?: string | undefined;
|
|
36
|
+
startedAt?: number | undefined;
|
|
37
|
+
completedAt?: number | undefined;
|
|
38
|
+
retries: number;
|
|
39
|
+
/** Per-task model assignment (overrides the run default), if set. */
|
|
40
|
+
model?: string | undefined;
|
|
41
|
+
/** Per-task provider assignment (overrides the run default), if set. */
|
|
42
|
+
provider?: string | undefined;
|
|
43
|
+
/** Per-task fallback model chain (overrides the run default), if set. */
|
|
44
|
+
fallbackModels?: string[] | undefined;
|
|
45
|
+
/** Per-task completion-gate verification command, if set. */
|
|
46
|
+
verificationCommand?: string | undefined;
|
|
47
|
+
}
|
|
48
|
+
/** A topological column: tasks whose deepest dependency chain is `depth`. */
|
|
49
|
+
export interface SddBoardColumn {
|
|
50
|
+
label: string;
|
|
51
|
+
/** Short ids of the tasks in this column (join against `tasks`). */
|
|
52
|
+
taskIds: string[];
|
|
53
|
+
}
|
|
54
|
+
export interface SddDeadlockChain {
|
|
55
|
+
/** Short id of the blocked task. */
|
|
56
|
+
blocked: string;
|
|
57
|
+
/** Short ids of the failed/incomplete blockers holding it. */
|
|
58
|
+
blockedBy: string[];
|
|
59
|
+
}
|
|
60
|
+
/** One entry in the live activity feed (the board's "what just happened" ticker). */
|
|
61
|
+
export interface SddBoardFeedEntry {
|
|
62
|
+
ts: number;
|
|
63
|
+
kind: 'started' | 'completed' | 'failed' | 'retrying' | 'wave' | 'deadlock' | 'verification_failed' | 'conflict' | 'split' | 'supervisor';
|
|
64
|
+
/** Short id of the task this entry concerns, when applicable. */
|
|
65
|
+
taskShortId?: string | undefined;
|
|
66
|
+
/** Worker involved, when applicable. */
|
|
67
|
+
agentName?: string | undefined;
|
|
68
|
+
/** Human-readable one-line summary. */
|
|
69
|
+
text: string;
|
|
70
|
+
}
|
|
71
|
+
export interface SddBoardSnapshot {
|
|
72
|
+
runId: string;
|
|
73
|
+
specId?: string | undefined;
|
|
74
|
+
graphId: string;
|
|
75
|
+
title: string;
|
|
76
|
+
status: SddBoardStatus;
|
|
77
|
+
startedAt: number;
|
|
78
|
+
updatedAt: number;
|
|
79
|
+
progress: TaskProgress;
|
|
80
|
+
/** Current wave index (0-based) of the parallel run. */
|
|
81
|
+
wave: number;
|
|
82
|
+
tasks: SddBoardTask[];
|
|
83
|
+
columns: SddBoardColumn[];
|
|
84
|
+
diagnostics?: {
|
|
85
|
+
deadlockChains?: SddDeadlockChain[];
|
|
86
|
+
} | undefined;
|
|
87
|
+
/** Live activity feed — most recent first (capped). */
|
|
88
|
+
feed?: SddBoardFeedEntry[] | undefined;
|
|
89
|
+
/** Run-level default worker model (task overrides take precedence). */
|
|
90
|
+
defaultModel?: string | undefined;
|
|
91
|
+
/** Run-level default worker provider. */
|
|
92
|
+
defaultProvider?: string | undefined;
|
|
93
|
+
/** Run-level default fallback model chain. */
|
|
94
|
+
fallbackModels?: string[] | undefined;
|
|
95
|
+
/** Base branch the run's squash commits land on (worktree runs only). */
|
|
96
|
+
baseBranch?: string | undefined;
|
|
97
|
+
/**
|
|
98
|
+
* Squash commits the run landed on the base branch, in landing order. Lets a
|
|
99
|
+
* post-run `/sdd rollback` revert them from disk after the live run is gone.
|
|
100
|
+
*/
|
|
101
|
+
mergedCommits?: Array<{
|
|
102
|
+
taskId: string;
|
|
103
|
+
sha: string;
|
|
104
|
+
title: string;
|
|
105
|
+
}> | undefined;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Lay a TaskGraph's nodes into topological dependency columns with stable short
|
|
109
|
+
* ids and per-task blocker refs. Shared by the projector (live) and any static
|
|
110
|
+
* board browser. Pure; no run state — `agentName`/`worktreeBranch`/`retries`
|
|
111
|
+
* are read from the node's `assignee`/`metadata` so a reload reflects the last
|
|
112
|
+
* persisted run.
|
|
113
|
+
*/
|
|
114
|
+
/**
|
|
115
|
+
* Stable short-id map (t01, t02, …) for a graph's nodes in creation order.
|
|
116
|
+
* Shared by the board renderer and the projector (deadlock-chain labelling).
|
|
117
|
+
*/
|
|
118
|
+
export declare function shortIdMap(graph: TaskGraph): Map<string, string>;
|
|
119
|
+
export declare function buildBoardTasks(graph: TaskGraph): {
|
|
120
|
+
tasks: SddBoardTask[];
|
|
121
|
+
columns: SddBoardColumn[];
|
|
122
|
+
};
|
|
123
|
+
/**
|
|
124
|
+
* Build a full board snapshot from a graph + run state. The projector calls
|
|
125
|
+
* this on every (throttled) change.
|
|
126
|
+
*/
|
|
127
|
+
export declare function buildBoardSnapshot(graph: TaskGraph, run: {
|
|
128
|
+
runId: string;
|
|
129
|
+
specId?: string | undefined;
|
|
130
|
+
status: SddBoardStatus;
|
|
131
|
+
startedAt: number;
|
|
132
|
+
wave: number;
|
|
133
|
+
deadlockChains?: SddDeadlockChain[] | undefined;
|
|
134
|
+
defaultModel?: string | undefined;
|
|
135
|
+
defaultProvider?: string | undefined;
|
|
136
|
+
fallbackModels?: string[] | undefined;
|
|
137
|
+
baseBranch?: string | undefined;
|
|
138
|
+
mergedCommits?: Array<{
|
|
139
|
+
taskId: string;
|
|
140
|
+
sha: string;
|
|
141
|
+
title: string;
|
|
142
|
+
}> | undefined;
|
|
143
|
+
}, now: number): SddBoardSnapshot;
|
|
144
|
+
//# sourceMappingURL=board-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"board-types.d.ts","sourceRoot":"","sources":["../src/board-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAGhF,MAAM,MAAM,cAAc,GACtB,MAAM,GACN,SAAS,GACT,QAAQ,GACR,SAAS,GACT,WAAW,GACX,QAAQ,GACR,YAAY,CAAC;AAEjB;;;;;GAKG;AACH,MAAM,MAAM,oBAAoB,GAAG,QAAQ,CAAC,QAAQ,CAAC,GAAG,QAAQ,GAAG,WAAW,CAAC;AAE/E,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,uDAAuD;IACvD,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAC3B,aAAa,EAAE,oBAAoB,CAAC;IACpC,QAAQ,EAAE,QAAQ,CAAC,UAAU,CAAC,CAAC;IAC/B,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IACvB,qEAAqE;IACrE,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,iEAAiE;IACjE,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,4DAA4D;IAC5D,cAAc,CAAC,EA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;IAC5B,MAAM,EAAE,cAAc,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,CAAC,EAAE,gBAAgB,EAAE,GAAG,SAAS,CAAC;IAChD,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,eAAe,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,cAAc,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;IACtC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,aAAa,CAAC,EAAE,KAAK,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,GAAG,SAAS,CAAC;CACnF,EACD,GAAG,EAAE,MAAM,GACV,gBAAgB,CAqBlB"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { TaskNode } from '@wrongstack/core/types';
|
|
2
|
+
export type ConflictSide = 'incoming' | 'base';
|
|
3
|
+
/**
|
|
4
|
+
* Resolve every standard git conflict hunk in `text` by keeping `side`. Handles
|
|
5
|
+
* both 2-way (`<<<<<<< / ======= / >>>>>>>`) and diff3 (`||||||| base`) markers.
|
|
6
|
+
* Returns the rewritten text (markers removed).
|
|
7
|
+
*/
|
|
8
|
+
export declare function resolveConflictText(text: string, side: ConflictSide): string;
|
|
9
|
+
/** True when `text` still contains a git conflict marker line. */
|
|
10
|
+
export declare function hasConflictMarkers(text: string): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Build a `conflictResolver` that keeps `side` of every hunk in each conflicted
|
|
13
|
+
* file. Returns false (abort → conservative fail) if any file can't be read,
|
|
14
|
+
* written, or still has markers after the rewrite.
|
|
15
|
+
*/
|
|
16
|
+
export declare function makePreferSideConflictResolver(side: ConflictSide): (info: {
|
|
17
|
+
task: TaskNode;
|
|
18
|
+
conflictFiles: string[];
|
|
19
|
+
cwd: string;
|
|
20
|
+
}) => Promise<boolean>;
|
|
21
|
+
export interface LlmConflictResolverOptions {
|
|
22
|
+
/** Runs one self-contained, isolated LLM turn and resolves its final text. */
|
|
23
|
+
run: (prompt: string) => Promise<string>;
|
|
24
|
+
/**
|
|
25
|
+
* Reject a resolution that shrinks the file below this fraction of its original
|
|
26
|
+
* non-marker line count — a crude guard against the model dropping content.
|
|
27
|
+
* Default 0.5.
|
|
28
|
+
*/
|
|
29
|
+
minRetainedFraction?: number;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Build an LLM-backed `conflictResolver`: for each conflicted file it asks the
|
|
33
|
+
* model (via one isolated `run` turn) to produce the fully resolved file and
|
|
34
|
+
* writes it back. Heavily guarded — returns false (→ conservative abort/retry)
|
|
35
|
+
* if the model leaves a marker, returns junk, or drops too much content. The
|
|
36
|
+
* WorktreeManager STILL rejects any surviving marker, and (when a `verifyTask`
|
|
37
|
+
* is configured) the run re-verifies the integrated base and reverts a
|
|
38
|
+
* regression — so a bad LLM merge can never silently stick. OFF by default.
|
|
39
|
+
*/
|
|
40
|
+
export declare function makeLlmConflictResolver(opts: LlmConflictResolverOptions): (info: {
|
|
41
|
+
task: TaskNode;
|
|
42
|
+
conflictFiles: string[];
|
|
43
|
+
cwd: string;
|
|
44
|
+
}) => Promise<boolean>;
|
|
45
|
+
//# sourceMappingURL=conflict-resolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conflict-resolver.d.ts","sourceRoot":"","sources":["../src/conflict-resolver.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAMvD,MAAM,MAAM,YAAY,GAAG,UAAU,GAAG,MAAM,CAAC;AAO/C;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,GAAG,MAAM,CA4B5E;AAED,kEAAkE;AAClE,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAKxD;AAED;;;;GAIG;AACH,wBAAgB,8BAA8B,CAAC,IAAI,EAAE,YAAY,UAClB;IAC3C,IAAI,EAAE,QAAQ,CAAC;IACf,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,GAAG,EAAE,MAAM,CAAC;CACb,KAAG,OAAO,CAAC,OAAO,CAAC,CAoBrB;AAED,MAAM,WAAW,0BAA0B;IACzC,8EAA8E;IAC9E,GAAG,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACzC;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAgBD;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,0BAA0B,UAGzB;IAC3C,IAAI,EAAE,QAAQ,CAAC;IACf,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,GAAG,EAAE,MAAM,CAAC;CACb,KAAG,OAAO,CAAC,OAAO,CAAC,CAyCrB"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { TaskGraph } from '@wrongstack/core/types';
|
|
2
|
+
/**
|
|
3
|
+
* Enhanced critical path analysis with bottleneck detection,
|
|
4
|
+
* parallel execution groups, and time estimation.
|
|
5
|
+
*/
|
|
6
|
+
export interface CriticalPathAnalysis {
|
|
7
|
+
/** Ordered list of critical path task IDs. */
|
|
8
|
+
criticalPath: string[];
|
|
9
|
+
/** Total estimated hours for the critical path. */
|
|
10
|
+
totalHours: number;
|
|
11
|
+
/** Tasks that block the most downstream work. */
|
|
12
|
+
bottlenecks: BottleneckTask[];
|
|
13
|
+
/** Groups of tasks that can run in parallel. */
|
|
14
|
+
parallelGroups: string[][];
|
|
15
|
+
/** Recommended execution order respecting dependencies. */
|
|
16
|
+
executionOrder: string[];
|
|
17
|
+
/** Tasks with no blockers (can start immediately). */
|
|
18
|
+
readyTasks: string[];
|
|
19
|
+
/** Tasks that are blocked and cannot start. */
|
|
20
|
+
blockedTasks: string[];
|
|
21
|
+
}
|
|
22
|
+
export interface BottleneckTask {
|
|
23
|
+
taskId: string;
|
|
24
|
+
title: string;
|
|
25
|
+
/** Number of tasks directly or transitively blocked by this task. */
|
|
26
|
+
blockedCount: number;
|
|
27
|
+
/** Total estimated hours of blocked downstream work. */
|
|
28
|
+
blockedHours: number;
|
|
29
|
+
/** Severity score (0-100). */
|
|
30
|
+
severity: number;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Analyze a task graph and return critical path analysis.
|
|
34
|
+
*/
|
|
35
|
+
export declare function analyzeCriticalPath(graph: TaskGraph): CriticalPathAnalysis;
|
|
36
|
+
//# sourceMappingURL=critical-path.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"critical-path.d.ts","sourceRoot":"","sources":["../src/critical-path.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAExD;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,8CAA8C;IAC9C,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,mDAAmD;IACnD,UAAU,EAAE,MAAM,CAAC;IACnB,iDAAiD;IACjD,WAAW,EAAE,cAAc,EAAE,CAAC;IAC9B,gDAAgD;IAChD,cAAc,EAAE,MAAM,EAAE,EAAE,CAAC;IAC3B,2DAA2D;IAC3D,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,sDAAsD;IACtD,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,+CAA+C;IAC/C,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,qEAAqE;IACrE,YAAY,EAAE,MAAM,CAAC;IACrB,wDAAwD;IACxD,YAAY,EAAE,MAAM,CAAC;IACrB,8BAA8B;IAC9B,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,SAAS,GAAG,oBAAoB,CA0F1E"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { TaskNode } from '@wrongstack/core/types';
|
|
2
|
+
import type { SddSubtaskSpec } from './sdd-parallel-run.js';
|
|
3
|
+
export interface SubtaskGeneratorOptions {
|
|
4
|
+
/** Runs one self-contained, isolated LLM turn and resolves its final text. */
|
|
5
|
+
run: (prompt: string) => Promise<string>;
|
|
6
|
+
/** Minimum well-formed sub-tasks required to accept a split. Default 2. */
|
|
7
|
+
minSubtasks?: number;
|
|
8
|
+
/** Maximum sub-tasks kept (excess is dropped). Default 4. */
|
|
9
|
+
maxSubtasks?: number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Build a `SddSupervisorOptions.generateSubtasks` closure backed by an LLM turn.
|
|
13
|
+
* Returns [] on any failure (parse error, too few valid items, runner throw), so
|
|
14
|
+
* the supervisor safely degrades a `split` verdict into a retry.
|
|
15
|
+
*/
|
|
16
|
+
export declare function makeLlmSubtaskGenerator(opts: SubtaskGeneratorOptions): (info: {
|
|
17
|
+
task: TaskNode;
|
|
18
|
+
error: string;
|
|
19
|
+
}) => Promise<SddSubtaskSpec[]>;
|
|
20
|
+
//# sourceMappingURL=decompose-task.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decompose-task.d.ts","sourceRoot":"","sources":["../src/decompose-task.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,QAAQ,EAA0B,MAAM,wBAAwB,CAAC;AAK/E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAK5D,MAAM,WAAW,uBAAuB;IACtC,8EAA8E;IAC9E,GAAG,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACzC,2EAA2E;IAC3E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6DAA6D;IAC7D,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AA2BD;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,uBAAuB,UAItB;IAC3C,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf,KAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CAsC9B"}
|