@calmo/task-runner 3.4.0 → 3.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/.github/dependabot.yml +7 -7
- package/.github/workflows/ci.yml +4 -4
- package/.jules/backlog_maniac.md +1 -0
- package/.jules/nexus.md +1 -0
- package/.jules/sentinel.md +1 -0
- package/.releaserc.json +2 -7
- package/AGENTS.md +21 -16
- package/CHANGELOG.md +192 -174
- package/README.md +95 -88
- package/coverage/coverage-final.json +9 -9
- package/coverage/index.html +9 -9
- package/coverage/lcov-report/index.html +9 -9
- package/coverage/lcov-report/src/EventBus.ts.html +30 -24
- package/coverage/lcov-report/src/TaskGraphValidationError.ts.html +12 -3
- package/coverage/lcov-report/src/TaskGraphValidator.ts.html +152 -137
- package/coverage/lcov-report/src/TaskRunner.ts.html +48 -45
- package/coverage/lcov-report/src/TaskRunnerBuilder.ts.html +29 -5
- package/coverage/lcov-report/src/TaskRunnerExecutionConfig.ts.html +1 -1
- package/coverage/lcov-report/src/TaskStateManager.ts.html +82 -52
- package/coverage/lcov-report/src/WorkflowExecutor.ts.html +210 -66
- package/coverage/lcov-report/src/contracts/RunnerEvents.ts.html +1 -1
- package/coverage/lcov-report/src/contracts/index.html +1 -1
- package/coverage/lcov-report/src/index.html +16 -16
- package/coverage/lcov-report/src/strategies/DryRunExecutionStrategy.ts.html +4 -4
- package/coverage/lcov-report/src/strategies/RetryingExecutionStrategy.ts.html +29 -11
- package/coverage/lcov-report/src/strategies/StandardExecutionStrategy.ts.html +7 -7
- package/coverage/lcov-report/src/strategies/index.html +1 -1
- package/coverage/lcov.info +426 -383
- package/coverage/src/EventBus.ts.html +30 -24
- package/coverage/src/TaskGraphValidationError.ts.html +12 -3
- package/coverage/src/TaskGraphValidator.ts.html +152 -137
- package/coverage/src/TaskRunner.ts.html +48 -45
- package/coverage/src/TaskRunnerBuilder.ts.html +29 -5
- package/coverage/src/TaskRunnerExecutionConfig.ts.html +1 -1
- package/coverage/src/TaskStateManager.ts.html +82 -52
- package/coverage/src/WorkflowExecutor.ts.html +210 -66
- package/coverage/src/contracts/RunnerEvents.ts.html +1 -1
- package/coverage/src/contracts/index.html +1 -1
- package/coverage/src/index.html +16 -16
- package/coverage/src/strategies/DryRunExecutionStrategy.ts.html +4 -4
- package/coverage/src/strategies/RetryingExecutionStrategy.ts.html +29 -11
- package/coverage/src/strategies/StandardExecutionStrategy.ts.html +7 -7
- package/coverage/src/strategies/index.html +1 -1
- package/dist/EventBus.js +13 -11
- package/dist/EventBus.js.map +1 -1
- package/dist/TaskGraphValidationError.js.map +1 -1
- package/dist/TaskGraphValidator.js +9 -9
- package/dist/TaskGraphValidator.js.map +1 -1
- package/dist/TaskRunner.js.map +1 -1
- package/dist/TaskRunnerBuilder.js.map +1 -1
- package/dist/TaskStateManager.d.ts +6 -0
- package/dist/TaskStateManager.js +11 -2
- package/dist/TaskStateManager.js.map +1 -1
- package/dist/TaskStep.d.ts +5 -0
- package/dist/WorkflowExecutor.js +49 -7
- package/dist/WorkflowExecutor.js.map +1 -1
- package/dist/strategies/RetryingExecutionStrategy.js +3 -1
- package/dist/strategies/RetryingExecutionStrategy.js.map +1 -1
- package/dist/strategies/StandardExecutionStrategy.js +1 -1
- package/dist/strategies/StandardExecutionStrategy.js.map +1 -1
- package/openspec/AGENTS.md +81 -15
- package/openspec/changes/archive/2026-01-18-add-concurrency-control/proposal.md +7 -4
- package/openspec/changes/archive/2026-01-18-add-concurrency-control/tasks.md +1 -0
- package/openspec/changes/archive/2026-01-18-add-external-task-cancellation/proposal.md +4 -1
- package/openspec/changes/archive/2026-01-18-add-external-task-cancellation/tasks.md +2 -1
- package/openspec/changes/archive/2026-01-18-add-integration-tests/proposal.md +3 -0
- package/openspec/changes/archive/2026-01-18-add-integration-tests/tasks.md +1 -0
- package/openspec/changes/archive/2026-01-18-add-task-retry-policy/proposal.md +3 -0
- package/openspec/changes/archive/2026-01-18-add-task-retry-policy/tasks.md +1 -0
- package/openspec/changes/archive/2026-01-18-add-workflow-preview/proposal.md +3 -0
- package/openspec/changes/archive/2026-01-18-add-workflow-preview/tasks.md +1 -0
- package/openspec/changes/archive/2026-01-18-feat-conditional-execution/proposal.md +35 -0
- package/openspec/changes/archive/2026-01-18-feat-conditional-execution/tasks.md +32 -0
- package/openspec/changes/archive/2026-01-18-refactor-core-architecture/proposal.md +3 -0
- package/openspec/changes/archive/2026-01-18-refactor-core-architecture/tasks.md +1 -0
- package/openspec/changes/feat-per-task-timeout/proposal.md +11 -6
- package/openspec/changes/feat-per-task-timeout/tasks.md +1 -1
- package/openspec/project.md +21 -15
- package/package.json +2 -1
- package/src/EventBus.ts +18 -16
- package/src/TaskGraph.ts +8 -8
- package/src/TaskGraphValidationError.ts +4 -1
- package/src/TaskGraphValidator.ts +148 -143
- package/src/TaskRunner.ts +42 -41
- package/src/TaskRunnerBuilder.ts +11 -3
- package/src/TaskStateManager.ts +12 -2
- package/src/TaskStep.ts +6 -0
- package/src/WorkflowExecutor.ts +63 -15
- package/src/contracts/ITaskGraphValidator.ts +12 -12
- package/src/contracts/ValidationError.ts +6 -6
- package/src/contracts/ValidationResult.ts +4 -4
- package/src/strategies/DryRunExecutionStrategy.ts +3 -3
- package/src/strategies/RetryingExecutionStrategy.ts +15 -9
- package/src/strategies/StandardExecutionStrategy.ts +4 -4
- package/test-report.xml +132 -108
|
@@ -153,7 +153,15 @@
|
|
|
153
153
|
<a name='L88'></a><a href='#L88'>88</a>
|
|
154
154
|
<a name='L89'></a><a href='#L89'>89</a>
|
|
155
155
|
<a name='L90'></a><a href='#L90'>90</a>
|
|
156
|
-
<a name='L91'></a><a href='#L91'>91</a
|
|
156
|
+
<a name='L91'></a><a href='#L91'>91</a>
|
|
157
|
+
<a name='L92'></a><a href='#L92'>92</a>
|
|
158
|
+
<a name='L93'></a><a href='#L93'>93</a>
|
|
159
|
+
<a name='L94'></a><a href='#L94'>94</a>
|
|
160
|
+
<a name='L95'></a><a href='#L95'>95</a>
|
|
161
|
+
<a name='L96'></a><a href='#L96'>96</a>
|
|
162
|
+
<a name='L97'></a><a href='#L97'>97</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
163
|
+
<span class="cline-any cline-neutral"> </span>
|
|
164
|
+
<span class="cline-any cline-neutral"> </span>
|
|
157
165
|
<span class="cline-any cline-neutral"> </span>
|
|
158
166
|
<span class="cline-any cline-neutral"> </span>
|
|
159
167
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -186,6 +194,10 @@
|
|
|
186
194
|
<span class="cline-any cline-yes">12x</span>
|
|
187
195
|
<span class="cline-any cline-neutral"> </span>
|
|
188
196
|
<span class="cline-any cline-yes">12x</span>
|
|
197
|
+
<span class="cline-any cline-neutral"> </span>
|
|
198
|
+
<span class="cline-any cline-neutral"> </span>
|
|
199
|
+
<span class="cline-any cline-neutral"> </span>
|
|
200
|
+
<span class="cline-any cline-neutral"> </span>
|
|
189
201
|
<span class="cline-any cline-yes">1x</span>
|
|
190
202
|
<span class="cline-any cline-neutral"> </span>
|
|
191
203
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -250,7 +262,9 @@ import { TaskResult } from "../TaskResult.js";
|
|
|
250
262
|
/**
|
|
251
263
|
* Execution strategy that retries tasks upon failure based on their retry configuration.
|
|
252
264
|
*/
|
|
253
|
-
export class RetryingExecutionStrategy<
|
|
265
|
+
export class RetryingExecutionStrategy<
|
|
266
|
+
TContext,
|
|
267
|
+
> implements IExecutionStrategy<TContext> {
|
|
254
268
|
constructor(private innerStrategy: IExecutionStrategy<TContext>) {}
|
|
255
269
|
|
|
256
270
|
async execute(
|
|
@@ -275,7 +289,11 @@ export class RetryingExecutionStrategy<TContext> implements IExecutionStra
|
|
|
275
289
|
|
|
276
290
|
const result = await this.innerStrategy.execute(step, context, signal);
|
|
277
291
|
|
|
278
|
-
if (
|
|
292
|
+
if (
|
|
293
|
+
result.status === "success" ||
|
|
294
|
+
result.status === "cancelled" ||
|
|
295
|
+
result.status === "skipped"
|
|
296
|
+
) {
|
|
279
297
|
return result;
|
|
280
298
|
}
|
|
281
299
|
|
|
@@ -296,13 +314,13 @@ export class RetryingExecutionStrategy<TContext> implements IExecutionStra
|
|
|
296
314
|
try {
|
|
297
315
|
await this.sleep(delay, signal);
|
|
298
316
|
} catch (e) {
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
317
|
+
if (signal?.aborted) {
|
|
318
|
+
return {
|
|
319
|
+
status: "cancelled",
|
|
320
|
+
message: "Task cancelled during retry delay",
|
|
321
|
+
};
|
|
322
|
+
}
|
|
323
|
+
throw e;
|
|
306
324
|
}
|
|
307
325
|
}
|
|
308
326
|
}
|
|
@@ -340,7 +358,7 @@ export class RetryingExecutionStrategy<TContext> implements IExecutionStra
|
|
|
340
358
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
341
359
|
Code coverage generated by
|
|
342
360
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
343
|
-
at 2026-01-
|
|
361
|
+
at 2026-01-18T23:00:28.573Z
|
|
344
362
|
</div>
|
|
345
363
|
<script src="../../prettify.js"></script>
|
|
346
364
|
<script>
|
|
@@ -113,8 +113,8 @@
|
|
|
113
113
|
<span class="cline-any cline-neutral"> </span>
|
|
114
114
|
<span class="cline-any cline-neutral"> </span>
|
|
115
115
|
<span class="cline-any cline-neutral"> </span>
|
|
116
|
-
<span class="cline-any cline-yes">
|
|
117
|
-
<span class="cline-any cline-yes">
|
|
116
|
+
<span class="cline-any cline-yes">131x</span>
|
|
117
|
+
<span class="cline-any cline-yes">131x</span>
|
|
118
118
|
<span class="cline-any cline-neutral"> </span>
|
|
119
119
|
<span class="cline-any cline-neutral"> </span>
|
|
120
120
|
<span class="cline-any cline-yes">10x</span>
|
|
@@ -140,9 +140,9 @@ import { TaskResult } from "../TaskResult.js";
|
|
|
140
140
|
/**
|
|
141
141
|
* Standard execution strategy that runs the task's run method.
|
|
142
142
|
*/
|
|
143
|
-
export class StandardExecutionStrategy<
|
|
144
|
-
|
|
145
|
-
{
|
|
143
|
+
export class StandardExecutionStrategy<
|
|
144
|
+
TContext,
|
|
145
|
+
> implements IExecutionStrategy<TContext> {
|
|
146
146
|
async execute(
|
|
147
147
|
step: TaskStep<TContext>,
|
|
148
148
|
context: TContext,
|
|
@@ -154,7 +154,7 @@ export class StandardExecutionStrategy<TContext>
|
|
|
154
154
|
// Check if error is due to abort
|
|
155
155
|
if (
|
|
156
156
|
signal?.aborted &&
|
|
157
|
-
(e instanceof Error && e.name === "AbortError" || signal.reason === e)
|
|
157
|
+
((e instanceof Error && e.name === "AbortError") || signal.reason === e)
|
|
158
158
|
) {
|
|
159
159
|
return {
|
|
160
160
|
status: "cancelled",
|
|
@@ -175,7 +175,7 @@ export class StandardExecutionStrategy<TContext>
|
|
|
175
175
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
176
176
|
Code coverage generated by
|
|
177
177
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
178
|
-
at 2026-01-
|
|
178
|
+
at 2026-01-18T23:00:28.573Z
|
|
179
179
|
</div>
|
|
180
180
|
<script src="../../prettify.js"></script>
|
|
181
181
|
<script>
|
|
@@ -131,7 +131,7 @@
|
|
|
131
131
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
132
132
|
Code coverage generated by
|
|
133
133
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
134
|
-
at 2026-01-
|
|
134
|
+
at 2026-01-18T23:00:28.573Z
|
|
135
135
|
</div>
|
|
136
136
|
<script src="../../prettify.js"></script>
|
|
137
137
|
<script>
|