@calmo/task-runner 2.0.0 → 3.1.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/.jules/nexus.md +5 -0
- package/AGENTS.md +49 -0
- package/CHANGELOG.md +33 -0
- package/README.md +1 -1
- package/coverage/coverage-final.json +9 -4
- package/coverage/index.html +24 -9
- package/coverage/lcov-report/index.html +24 -9
- package/coverage/lcov-report/src/EventBus.ts.html +8 -8
- package/coverage/lcov-report/src/TaskGraphValidator.ts.html +53 -53
- package/coverage/lcov-report/src/TaskRunner.ts.html +377 -20
- package/coverage/lcov-report/src/TaskRunnerBuilder.ts.html +313 -0
- package/coverage/lcov-report/src/TaskRunnerExecutionConfig.ts.html +139 -0
- package/coverage/lcov-report/src/TaskStateManager.ts.html +511 -0
- package/coverage/lcov-report/src/WorkflowExecutor.ts.html +119 -137
- 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 +56 -11
- package/coverage/lcov-report/src/strategies/DryRunExecutionStrategy.ts.html +178 -0
- package/coverage/lcov-report/src/strategies/StandardExecutionStrategy.ts.html +190 -0
- package/coverage/lcov-report/src/strategies/index.html +131 -0
- package/coverage/lcov.info +419 -204
- package/coverage/src/EventBus.ts.html +8 -8
- package/coverage/src/TaskGraphValidator.ts.html +53 -53
- package/coverage/src/TaskRunner.ts.html +377 -20
- package/coverage/src/TaskRunnerBuilder.ts.html +313 -0
- package/coverage/src/TaskRunnerExecutionConfig.ts.html +139 -0
- package/coverage/src/TaskStateManager.ts.html +511 -0
- package/coverage/src/WorkflowExecutor.ts.html +119 -137
- package/coverage/src/contracts/RunnerEvents.ts.html +1 -1
- package/coverage/src/contracts/index.html +1 -1
- package/coverage/src/index.html +56 -11
- package/coverage/src/strategies/DryRunExecutionStrategy.ts.html +178 -0
- package/coverage/src/strategies/StandardExecutionStrategy.ts.html +190 -0
- package/coverage/src/strategies/index.html +131 -0
- package/dist/TaskRunner.d.ts +24 -2
- package/dist/TaskRunner.js +99 -3
- package/dist/TaskRunner.js.map +1 -1
- package/dist/TaskRunnerBuilder.d.ts +33 -0
- package/dist/TaskRunnerBuilder.js +54 -0
- package/dist/TaskRunnerBuilder.js.map +1 -0
- package/dist/TaskRunnerExecutionConfig.d.ts +18 -0
- package/dist/TaskRunnerExecutionConfig.js +2 -0
- package/dist/TaskRunnerExecutionConfig.js.map +1 -0
- package/dist/TaskStateManager.d.ts +54 -0
- package/dist/TaskStateManager.js +130 -0
- package/dist/TaskStateManager.js.map +1 -0
- package/dist/TaskStatus.d.ts +1 -1
- package/dist/TaskStep.d.ts +2 -1
- package/dist/WorkflowExecutor.d.ts +11 -17
- package/dist/WorkflowExecutor.js +67 -69
- package/dist/WorkflowExecutor.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/strategies/DryRunExecutionStrategy.d.ts +16 -0
- package/dist/strategies/DryRunExecutionStrategy.js +25 -0
- package/dist/strategies/DryRunExecutionStrategy.js.map +1 -0
- package/dist/strategies/IExecutionStrategy.d.ts +16 -0
- package/dist/strategies/IExecutionStrategy.js +2 -0
- package/dist/strategies/IExecutionStrategy.js.map +1 -0
- package/dist/strategies/StandardExecutionStrategy.d.ts +9 -0
- package/dist/strategies/StandardExecutionStrategy.js +25 -0
- package/dist/strategies/StandardExecutionStrategy.js.map +1 -0
- package/openspec/changes/add-concurrency-control/proposal.md +14 -0
- package/openspec/changes/add-concurrency-control/tasks.md +9 -0
- package/openspec/changes/add-task-retry-policy/proposal.md +16 -0
- package/openspec/changes/add-task-retry-policy/tasks.md +10 -0
- package/openspec/changes/add-workflow-preview/proposal.md +13 -0
- package/openspec/changes/add-workflow-preview/tasks.md +7 -0
- package/openspec/changes/archive/2026-01-18-add-external-task-cancellation/tasks.md +10 -0
- package/openspec/changes/archive/2026-01-18-add-integration-tests/proposal.md +18 -0
- package/openspec/changes/archive/2026-01-18-add-integration-tests/tasks.md +17 -0
- package/openspec/changes/archive/2026-01-18-refactor-core-architecture/proposal.md +14 -0
- package/openspec/changes/archive/2026-01-18-refactor-core-architecture/tasks.md +8 -0
- package/openspec/changes/feat-per-task-timeout/proposal.md +25 -0
- package/openspec/changes/feat-per-task-timeout/tasks.md +27 -0
- package/package.json +1 -1
- package/src/TaskRunner.ts +123 -4
- package/src/TaskRunnerBuilder.ts +76 -0
- package/src/TaskRunnerExecutionConfig.ts +18 -0
- package/src/TaskStateManager.ts +142 -0
- package/src/TaskStatus.ts +1 -1
- package/src/TaskStep.ts +2 -1
- package/src/WorkflowExecutor.ts +77 -83
- package/src/index.ts +4 -0
- package/src/strategies/DryRunExecutionStrategy.ts +31 -0
- package/src/strategies/IExecutionStrategy.ts +21 -0
- package/src/strategies/StandardExecutionStrategy.ts +35 -0
- package/test-report.xml +139 -45
- package/GEMINI.md +0 -48
- package/openspec/changes/add-external-task-cancellation/tasks.md +0 -10
- /package/openspec/changes/{add-external-task-cancellation → archive/2026-01-18-add-external-task-cancellation}/proposal.md +0 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { TaskStep } from "../TaskStep.js";
|
|
2
|
+
import { TaskResult } from "../TaskResult.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Interface for task execution strategies.
|
|
6
|
+
* Allows different execution behaviors (e.g., standard, dry-run, debugging).
|
|
7
|
+
*/
|
|
8
|
+
export interface IExecutionStrategy<TContext> {
|
|
9
|
+
/**
|
|
10
|
+
* Executes a single task step.
|
|
11
|
+
* @param step The task step to execute.
|
|
12
|
+
* @param context The shared context.
|
|
13
|
+
* @param signal Optional abort signal.
|
|
14
|
+
* @returns A promise resolving to the task result.
|
|
15
|
+
*/
|
|
16
|
+
execute(
|
|
17
|
+
step: TaskStep<TContext>,
|
|
18
|
+
context: TContext,
|
|
19
|
+
signal?: AbortSignal
|
|
20
|
+
): Promise<TaskResult>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { IExecutionStrategy } from "./IExecutionStrategy.js";
|
|
2
|
+
import { TaskStep } from "../TaskStep.js";
|
|
3
|
+
import { TaskResult } from "../TaskResult.js";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Standard execution strategy that runs the task's run method.
|
|
7
|
+
*/
|
|
8
|
+
export class StandardExecutionStrategy<TContext>
|
|
9
|
+
implements IExecutionStrategy<TContext>
|
|
10
|
+
{
|
|
11
|
+
async execute(
|
|
12
|
+
step: TaskStep<TContext>,
|
|
13
|
+
context: TContext,
|
|
14
|
+
signal?: AbortSignal
|
|
15
|
+
): Promise<TaskResult> {
|
|
16
|
+
try {
|
|
17
|
+
return await step.run(context, signal);
|
|
18
|
+
} catch (e) {
|
|
19
|
+
// Check if error is due to abort
|
|
20
|
+
if (
|
|
21
|
+
signal?.aborted &&
|
|
22
|
+
(e instanceof Error && e.name === "AbortError" || signal.reason === e)
|
|
23
|
+
) {
|
|
24
|
+
return {
|
|
25
|
+
status: "cancelled",
|
|
26
|
+
message: "Task cancelled during execution",
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
return {
|
|
30
|
+
status: "failure",
|
|
31
|
+
error: e instanceof Error ? e.message : String(e),
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
package/test-report.xml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8" ?>
|
|
2
|
-
<testsuites name="vitest tests" tests="
|
|
3
|
-
<testsuite name="tests/ComplexScenario.test.ts" timestamp="2026-01-
|
|
4
|
-
<testcase classname="tests/ComplexScenario.test.ts" name="Complex Scenario Integration Tests > 1. All steps execute when all succeed and context is hydrated" time="0.
|
|
2
|
+
<testsuites name="vitest tests" tests="73" failures="0" errors="0" time="0.754679547">
|
|
3
|
+
<testsuite name="tests/ComplexScenario.test.ts" timestamp="2026-01-18T18:12:39.220Z" hostname="runnervmmtnos" tests="2" failures="0" errors="0" skipped="0" time="0.011704892">
|
|
4
|
+
<testcase classname="tests/ComplexScenario.test.ts" name="Complex Scenario Integration Tests > 1. All steps execute when all succeed and context is hydrated" time="0.007835477">
|
|
5
5
|
<system-out>
|
|
6
6
|
Running StepA
|
|
7
7
|
Running StepB
|
|
@@ -15,89 +15,183 @@ Running StepG
|
|
|
15
15
|
|
|
16
16
|
</system-out>
|
|
17
17
|
</testcase>
|
|
18
|
-
<testcase classname="tests/ComplexScenario.test.ts" name="Complex Scenario Integration Tests > 2. The 'skip' propagation works as intended if something breaks up in the tree" time="0.
|
|
18
|
+
<testcase classname="tests/ComplexScenario.test.ts" name="Complex Scenario Integration Tests > 2. The 'skip' propagation works as intended if something breaks up in the tree" time="0.001197405">
|
|
19
19
|
</testcase>
|
|
20
20
|
</testsuite>
|
|
21
|
-
<testsuite name="tests/
|
|
22
|
-
<testcase classname="tests/
|
|
21
|
+
<testsuite name="tests/DryRunExecutionStrategy.test.ts" timestamp="2026-01-18T18:12:39.221Z" hostname="runnervmmtnos" tests="1" failures="0" errors="0" skipped="0" time="0.003459238">
|
|
22
|
+
<testcase classname="tests/DryRunExecutionStrategy.test.ts" name="DryRunExecutionStrategy > should return success without running the task" time="0.001914755">
|
|
23
23
|
</testcase>
|
|
24
24
|
</testsuite>
|
|
25
|
-
<testsuite name="tests/
|
|
26
|
-
<testcase classname="tests/
|
|
25
|
+
<testsuite name="tests/EventBus.test.ts" timestamp="2026-01-18T18:12:39.222Z" hostname="runnervmmtnos" tests="1" failures="0" errors="0" skipped="0" time="0.017999624">
|
|
26
|
+
<testcase classname="tests/EventBus.test.ts" name="EventBus > should handle async listeners throwing errors without crashing" time="0.015821096">
|
|
27
27
|
</testcase>
|
|
28
|
-
|
|
28
|
+
</testsuite>
|
|
29
|
+
<testsuite name="tests/TaskGraphValidator.test.ts" timestamp="2026-01-18T18:12:39.222Z" hostname="runnervmmtnos" tests="9" failures="0" errors="0" skipped="0" time="0.011382149">
|
|
30
|
+
<testcase classname="tests/TaskGraphValidator.test.ts" name="TaskGraphValidator > should be instantiated" time="0.001899887">
|
|
31
|
+
</testcase>
|
|
32
|
+
<testcase classname="tests/TaskGraphValidator.test.ts" name="TaskGraphValidator > should return valid result for empty graph" time="0.001737874">
|
|
29
33
|
</testcase>
|
|
30
|
-
<testcase classname="tests/TaskGraphValidator.test.ts" name="TaskGraphValidator > should detect duplicate tasks" time="0.
|
|
34
|
+
<testcase classname="tests/TaskGraphValidator.test.ts" name="TaskGraphValidator > should detect duplicate tasks" time="0.002036873">
|
|
31
35
|
</testcase>
|
|
32
|
-
<testcase classname="tests/TaskGraphValidator.test.ts" name="TaskGraphValidator > should detect missing dependencies" time="0.
|
|
36
|
+
<testcase classname="tests/TaskGraphValidator.test.ts" name="TaskGraphValidator > should detect missing dependencies" time="0.000562039">
|
|
33
37
|
</testcase>
|
|
34
|
-
<testcase classname="tests/TaskGraphValidator.test.ts" name="TaskGraphValidator > should detect cycles" time="0.
|
|
38
|
+
<testcase classname="tests/TaskGraphValidator.test.ts" name="TaskGraphValidator > should detect cycles" time="0.000863322">
|
|
35
39
|
</testcase>
|
|
36
|
-
<testcase classname="tests/TaskGraphValidator.test.ts" name="TaskGraphValidator > should return valid for a correct graph" time="0.
|
|
40
|
+
<testcase classname="tests/TaskGraphValidator.test.ts" name="TaskGraphValidator > should return valid for a correct graph" time="0.000538966">
|
|
37
41
|
</testcase>
|
|
38
|
-
<testcase classname="tests/TaskGraphValidator.test.ts" name="TaskGraphValidator > should not detect cycles if missing dependencies are present" time="0.
|
|
42
|
+
<testcase classname="tests/TaskGraphValidator.test.ts" name="TaskGraphValidator > should not detect cycles if missing dependencies are present" time="0.000377365">
|
|
39
43
|
</testcase>
|
|
40
|
-
<testcase classname="tests/TaskGraphValidator.test.ts" name="TaskGraphValidator > should detect more complex cycles" time="0.
|
|
44
|
+
<testcase classname="tests/TaskGraphValidator.test.ts" name="TaskGraphValidator > should detect more complex cycles" time="0.000308877">
|
|
41
45
|
</testcase>
|
|
42
|
-
<testcase classname="tests/TaskGraphValidator.test.ts" name="TaskGraphValidator > should handle cycle detection with no cycles but shared dependencies" time="0.
|
|
46
|
+
<testcase classname="tests/TaskGraphValidator.test.ts" name="TaskGraphValidator > should handle cycle detection with no cycles but shared dependencies" time="0.00036466">
|
|
43
47
|
</testcase>
|
|
44
48
|
</testsuite>
|
|
45
|
-
<testsuite name="tests/TaskGraphValidatorDoS.test.ts" timestamp="2026-01-
|
|
46
|
-
<testcase classname="tests/TaskGraphValidatorDoS.test.ts" name="TaskGraphValidator - Deep Recursion > should handle deep graphs without stack overflow" time="0.
|
|
49
|
+
<testsuite name="tests/TaskGraphValidatorDoS.test.ts" timestamp="2026-01-18T18:12:39.225Z" hostname="runnervmmtnos" tests="1" failures="0" errors="0" skipped="0" time="0.041649175">
|
|
50
|
+
<testcase classname="tests/TaskGraphValidatorDoS.test.ts" name="TaskGraphValidator - Deep Recursion > should handle deep graphs without stack overflow" time="0.039614286">
|
|
47
51
|
</testcase>
|
|
48
52
|
</testsuite>
|
|
49
|
-
<testsuite name="tests/TaskRunner.test.ts" timestamp="2026-01-
|
|
50
|
-
<testcase classname="tests/TaskRunner.test.ts" name="TaskRunner > should run tasks in the correct sequential order" time="0.
|
|
53
|
+
<testsuite name="tests/TaskRunner.test.ts" timestamp="2026-01-18T18:12:39.225Z" hostname="runnervmmtnos" tests="10" failures="0" errors="0" skipped="0" time="0.11229965">
|
|
54
|
+
<testcase classname="tests/TaskRunner.test.ts" name="TaskRunner > should run tasks in the correct sequential order" time="0.004393812">
|
|
55
|
+
</testcase>
|
|
56
|
+
<testcase classname="tests/TaskRunner.test.ts" name="TaskRunner > should handle an empty list of tasks gracefully" time="0.000536321">
|
|
57
|
+
</testcase>
|
|
58
|
+
<testcase classname="tests/TaskRunner.test.ts" name="TaskRunner > should run independent tasks in parallel" time="0.100527713">
|
|
59
|
+
</testcase>
|
|
60
|
+
<testcase classname="tests/TaskRunner.test.ts" name="TaskRunner > should skip dependent tasks if a root task fails" time="0.000423">
|
|
61
|
+
</testcase>
|
|
62
|
+
<testcase classname="tests/TaskRunner.test.ts" name="TaskRunner > should throw an error for 'circular dependency'" time="0.001873287">
|
|
51
63
|
</testcase>
|
|
52
|
-
<testcase classname="tests/TaskRunner.test.ts" name="TaskRunner > should
|
|
64
|
+
<testcase classname="tests/TaskRunner.test.ts" name="TaskRunner > should throw an error for 'missing dependency'" time="0.00040734">
|
|
53
65
|
</testcase>
|
|
54
|
-
<testcase classname="tests/TaskRunner.test.ts" name="TaskRunner > should
|
|
66
|
+
<testcase classname="tests/TaskRunner.test.ts" name="TaskRunner > should handle tasks that throw an error during execution" time="0.000383796">
|
|
55
67
|
</testcase>
|
|
56
|
-
<testcase classname="tests/TaskRunner.test.ts" name="TaskRunner > should skip
|
|
68
|
+
<testcase classname="tests/TaskRunner.test.ts" name="TaskRunner > should skip tasks whose dependencies are skipped" time="0.000511766">
|
|
57
69
|
</testcase>
|
|
58
|
-
<testcase classname="tests/TaskRunner.test.ts" name="TaskRunner > should throw
|
|
70
|
+
<testcase classname="tests/TaskRunner.test.ts" name="TaskRunner > should handle tasks that throw a non-Error object during execution" time="0.000416708">
|
|
59
71
|
</testcase>
|
|
60
|
-
<testcase classname="tests/TaskRunner.test.ts" name="TaskRunner > should
|
|
72
|
+
<testcase classname="tests/TaskRunner.test.ts" name="TaskRunner > should handle duplicate steps where one gets skipped due to failed dependency" time="0.000533827">
|
|
61
73
|
</testcase>
|
|
62
|
-
|
|
74
|
+
</testsuite>
|
|
75
|
+
<testsuite name="tests/TaskRunnerEvents.test.ts" timestamp="2026-01-18T18:12:39.227Z" hostname="runnervmmtnos" tests="7" failures="0" errors="0" skipped="0" time="0.019539167">
|
|
76
|
+
<testcase classname="tests/TaskRunnerEvents.test.ts" name="TaskRunner Events > should fire all lifecycle events in a successful run" time="0.008228782">
|
|
77
|
+
</testcase>
|
|
78
|
+
<testcase classname="tests/TaskRunnerEvents.test.ts" name="TaskRunner Events > should fire taskSkipped event when dependency fails" time="0.00515295">
|
|
79
|
+
</testcase>
|
|
80
|
+
<testcase classname="tests/TaskRunnerEvents.test.ts" name="TaskRunner Events > should not crash if a listener throws an error" time="0.001447632">
|
|
63
81
|
</testcase>
|
|
64
|
-
<testcase classname="tests/
|
|
82
|
+
<testcase classname="tests/TaskRunnerEvents.test.ts" name="TaskRunner Events > should fire workflow events even for empty step list" time="0.000565135">
|
|
65
83
|
</testcase>
|
|
66
|
-
<testcase classname="tests/
|
|
84
|
+
<testcase classname="tests/TaskRunnerEvents.test.ts" name="TaskRunner Events > should handle unsubscribe correctly" time="0.000747466">
|
|
67
85
|
</testcase>
|
|
68
|
-
<testcase classname="tests/
|
|
86
|
+
<testcase classname="tests/TaskRunnerEvents.test.ts" name="TaskRunner Events > should safely handle off() when no listeners exist" time="0.000408022">
|
|
87
|
+
</testcase>
|
|
88
|
+
<testcase classname="tests/TaskRunnerEvents.test.ts" name="TaskRunner Events > should support multiple listeners for the same event" time="0.00061583">
|
|
69
89
|
</testcase>
|
|
70
90
|
</testsuite>
|
|
71
|
-
<testsuite name="tests/
|
|
72
|
-
<testcase classname="tests/
|
|
91
|
+
<testsuite name="tests/TaskRunnerMermaid.test.ts" timestamp="2026-01-18T18:12:39.228Z" hostname="runnervmmtnos" tests="4" failures="0" errors="0" skipped="0" time="0.00721517">
|
|
92
|
+
<testcase classname="tests/TaskRunnerMermaid.test.ts" name="TaskRunner Mermaid Graph > should generate a simple graph with no dependencies" time="0.003558584">
|
|
93
|
+
</testcase>
|
|
94
|
+
<testcase classname="tests/TaskRunnerMermaid.test.ts" name="TaskRunner Mermaid Graph > should generate a graph with dependencies" time="0.000646657">
|
|
95
|
+
</testcase>
|
|
96
|
+
<testcase classname="tests/TaskRunnerMermaid.test.ts" name="TaskRunner Mermaid Graph > should handle mixed independent and dependent tasks" time="0.000325818">
|
|
73
97
|
</testcase>
|
|
74
|
-
<testcase classname="tests/
|
|
98
|
+
<testcase classname="tests/TaskRunnerMermaid.test.ts" name="TaskRunner Mermaid Graph > should handle special characters in task names" time="0.000442687">
|
|
75
99
|
</testcase>
|
|
76
|
-
|
|
100
|
+
</testsuite>
|
|
101
|
+
<testsuite name="tests/TaskRunnerRefactor.test.ts" timestamp="2026-01-18T18:12:39.229Z" hostname="runnervmmtnos" tests="6" failures="0" errors="0" skipped="0" time="0.007211009">
|
|
102
|
+
<testcase classname="tests/TaskRunnerRefactor.test.ts" name="TaskRunner Refactor Coverage > should allow setting execution strategy" time="0.001715663">
|
|
103
|
+
</testcase>
|
|
104
|
+
<testcase classname="tests/TaskRunnerRefactor.test.ts" name="TaskRunner Refactor Coverage > should allow unsubscribing from events" time="0.000975977">
|
|
77
105
|
</testcase>
|
|
78
|
-
<testcase classname="tests/
|
|
106
|
+
<testcase classname="tests/TaskRunnerRefactor.test.ts" name="TaskRunner Refactor Coverage > TaskStateManager.cancelAllPending should handle non-existing tasks gracefully" time="0.000457464">
|
|
79
107
|
</testcase>
|
|
80
|
-
<testcase classname="tests/
|
|
108
|
+
<testcase classname="tests/TaskRunnerRefactor.test.ts" name="TaskRunner Refactor Coverage > TaskRunnerBuilder should build a TaskRunner" time="0.000437858">
|
|
81
109
|
</testcase>
|
|
82
|
-
<testcase classname="tests/
|
|
110
|
+
<testcase classname="tests/TaskRunnerRefactor.test.ts" name="TaskRunner Refactor Coverage > TaskRunnerBuilder should build a TaskRunner with no listeners" time="0.000220612">
|
|
83
111
|
</testcase>
|
|
84
|
-
<testcase classname="tests/
|
|
112
|
+
<testcase classname="tests/TaskRunnerRefactor.test.ts" name="TaskRunner Refactor Coverage > WorkflowExecutor should break infinite loop if no progress can be made" time="0.001620796">
|
|
85
113
|
</testcase>
|
|
86
114
|
</testsuite>
|
|
87
|
-
<testsuite name="tests/WorkflowExecutor.test.ts" timestamp="2026-01-
|
|
88
|
-
<testcase classname="tests/WorkflowExecutor.test.ts" name="WorkflowExecutor > should execute steps sequentially when dependencies exist" time="0.
|
|
115
|
+
<testsuite name="tests/WorkflowExecutor.test.ts" timestamp="2026-01-18T18:12:39.230Z" hostname="runnervmmtnos" tests="3" failures="0" errors="0" skipped="0" time="0.056302731">
|
|
116
|
+
<testcase classname="tests/WorkflowExecutor.test.ts" name="WorkflowExecutor > should execute steps sequentially when dependencies exist" time="0.003118142">
|
|
89
117
|
</testcase>
|
|
90
|
-
<testcase classname="tests/WorkflowExecutor.test.ts" name="WorkflowExecutor > should skip dependent steps if dependency fails" time="0.
|
|
118
|
+
<testcase classname="tests/WorkflowExecutor.test.ts" name="WorkflowExecutor > should skip dependent steps if dependency fails" time="0.000479806">
|
|
91
119
|
</testcase>
|
|
92
|
-
<testcase classname="tests/WorkflowExecutor.test.ts" name="WorkflowExecutor > should run independent steps in parallel" time="0.
|
|
120
|
+
<testcase classname="tests/WorkflowExecutor.test.ts" name="WorkflowExecutor > should run independent steps in parallel" time="0.050936934">
|
|
93
121
|
</testcase>
|
|
94
122
|
</testsuite>
|
|
95
|
-
<testsuite name="tests/
|
|
96
|
-
<testcase classname="tests/
|
|
123
|
+
<testsuite name="tests/cancellation.test.ts" timestamp="2026-01-18T18:12:39.231Z" hostname="runnervmmtnos" tests="10" failures="0" errors="0" skipped="0" time="0.160856804">
|
|
124
|
+
<testcase classname="tests/cancellation.test.ts" name="TaskRunner Cancellation > should execute tasks normally without cancellation" time="0.003322061">
|
|
125
|
+
</testcase>
|
|
126
|
+
<testcase classname="tests/cancellation.test.ts" name="TaskRunner Cancellation > should cancel workflow via AbortSignal" time="0.011234474">
|
|
127
|
+
</testcase>
|
|
128
|
+
<testcase classname="tests/cancellation.test.ts" name="TaskRunner Cancellation > should cancel workflow via global timeout" time="0.049697551">
|
|
129
|
+
</testcase>
|
|
130
|
+
<testcase classname="tests/cancellation.test.ts" name="TaskRunner Cancellation > should handle pre-aborted signal" time="0.000409645">
|
|
131
|
+
</testcase>
|
|
132
|
+
<testcase classname="tests/cancellation.test.ts" name="TaskRunner Cancellation > should propagate cancellation to running task" time="0.010620648">
|
|
97
133
|
</testcase>
|
|
98
|
-
<testcase classname="tests/
|
|
134
|
+
<testcase classname="tests/cancellation.test.ts" name="TaskRunner Cancellation > should respect timeout over signal if timeout happens first" time="0.050354487">
|
|
135
|
+
</testcase>
|
|
136
|
+
<testcase classname="tests/cancellation.test.ts" name="TaskRunner Cancellation > should handle case where timeout is set AND signal is already aborted" time="0.000521704">
|
|
137
|
+
</testcase>
|
|
138
|
+
<testcase classname="tests/cancellation.test.ts" name="TaskRunner Cancellation > should cancel workflow via AbortSignal when timeout is also set" time="0.010740512">
|
|
139
|
+
</testcase>
|
|
140
|
+
<testcase classname="tests/cancellation.test.ts" name="TaskRunner Cancellation > should fail task if it throws non-abort error during cancellation" time="0.011047434">
|
|
141
|
+
</testcase>
|
|
142
|
+
<testcase classname="tests/cancellation.test.ts" name="TaskRunner Cancellation > should cancel task if it rejects with signal.reason" time="0.010617862">
|
|
143
|
+
</testcase>
|
|
144
|
+
</testsuite>
|
|
145
|
+
<testsuite name="tests/integration.test.ts" timestamp="2026-01-18T18:12:39.233Z" hostname="runnervmmtnos" tests="3" failures="0" errors="0" skipped="0" time="0.008439546">
|
|
146
|
+
<testcase classname="tests/integration.test.ts" name="TaskRunner Validation Integration > should throw validation error with clear message for duplicate tasks" time="0.004750889">
|
|
99
147
|
</testcase>
|
|
100
|
-
<testcase classname="tests/integration.test.ts" name="TaskRunner Validation Integration > should throw validation error with clear message for
|
|
148
|
+
<testcase classname="tests/integration.test.ts" name="TaskRunner Validation Integration > should throw validation error with clear message for missing dependencies" time="0.000500514">
|
|
149
|
+
</testcase>
|
|
150
|
+
<testcase classname="tests/integration.test.ts" name="TaskRunner Validation Integration > should throw validation error with clear message for cycles" time="0.0004287">
|
|
151
|
+
</testcase>
|
|
152
|
+
</testsuite>
|
|
153
|
+
<testsuite name="tests/integration-tests/basic-structure.test.ts" timestamp="2026-01-18T18:12:39.234Z" hostname="runnervmmtnos" tests="4" failures="0" errors="0" skipped="0" time="0.130392981">
|
|
154
|
+
<testcase classname="tests/integration-tests/basic-structure.test.ts" name="Integration: Basic Structure > Scenario 1: Basic linear workflow (A -> B -> C)" time="0.034111162">
|
|
155
|
+
</testcase>
|
|
156
|
+
<testcase classname="tests/integration-tests/basic-structure.test.ts" name="Integration: Basic Structure > Scenario 2: Branching workflow (A -> [B, C] -> D)" time="0.032066264">
|
|
157
|
+
</testcase>
|
|
158
|
+
<testcase classname="tests/integration-tests/basic-structure.test.ts" name="Integration: Basic Structure > Scenario 12: Complex 'Diamond' dependency graph (A -> B -> D, A -> C -> D)" time="0.041142991">
|
|
159
|
+
</testcase>
|
|
160
|
+
<testcase classname="tests/integration-tests/basic-structure.test.ts" name="Integration: Basic Structure > Scenario 14: Zero-dependency parallel burst" time="0.021032996">
|
|
161
|
+
</testcase>
|
|
162
|
+
</testsuite>
|
|
163
|
+
<testsuite name="tests/integration-tests/concurrency-timing.test.ts" timestamp="2026-01-18T18:12:39.235Z" hostname="runnervmmtnos" tests="3" failures="0" errors="0" skipped="0" time="0.127910787">
|
|
164
|
+
<testcase classname="tests/integration-tests/concurrency-timing.test.ts" name="Integration: Concurrency and Timing > Scenario 6: Mixed duration tasks (verifying parallel efficiency)" time="0.053132093">
|
|
165
|
+
</testcase>
|
|
166
|
+
<testcase classname="tests/integration-tests/concurrency-timing.test.ts" name="Integration: Concurrency and Timing > Scenario 7: Cancellation via AbortSignal" time="0.021293783">
|
|
167
|
+
</testcase>
|
|
168
|
+
<testcase classname="tests/integration-tests/concurrency-timing.test.ts" name="Integration: Concurrency and Timing > Scenario 8: Global timeout interrupting long tasks" time="0.051132028">
|
|
169
|
+
</testcase>
|
|
170
|
+
</testsuite>
|
|
171
|
+
<testsuite name="tests/integration-tests/context-state.test.ts" timestamp="2026-01-18T18:12:39.236Z" hostname="runnervmmtnos" tests="3" failures="0" errors="0" skipped="0" time="0.016984148">
|
|
172
|
+
<testcase classname="tests/integration-tests/context-state.test.ts" name="Integration: Context and State > Scenario 4: Shared context mutation (A writes, B reads)" time="0.003976123">
|
|
173
|
+
</testcase>
|
|
174
|
+
<testcase classname="tests/integration-tests/context-state.test.ts" name="Integration: Context and State > Scenario 9: Dynamic context validation" time="0.000406148">
|
|
175
|
+
</testcase>
|
|
176
|
+
<testcase classname="tests/integration-tests/context-state.test.ts" name="Integration: Context and State > Scenario 13: Tasks with side-effects" time="0.010604287">
|
|
177
|
+
</testcase>
|
|
178
|
+
</testsuite>
|
|
179
|
+
<testsuite name="tests/integration-tests/dryRun.test.ts" timestamp="2026-01-18T18:12:39.237Z" hostname="runnervmmtnos" tests="2" failures="0" errors="0" skipped="0" time="0.007107349">
|
|
180
|
+
<testcase classname="tests/integration-tests/dryRun.test.ts" name="Integration: Dry Run > should execute successfully without side effects" time="0.00460069">
|
|
181
|
+
</testcase>
|
|
182
|
+
<testcase classname="tests/integration-tests/dryRun.test.ts" name="Integration: Dry Run > should respect dependencies (topological order is maintained even in dry run)" time="0.000409946">
|
|
183
|
+
</testcase>
|
|
184
|
+
</testsuite>
|
|
185
|
+
<testsuite name="tests/integration-tests/error-handling.test.ts" timestamp="2026-01-18T18:12:39.237Z" hostname="runnervmmtnos" tests="3" failures="0" errors="0" skipped="0" time="0.008123185">
|
|
186
|
+
<testcase classname="tests/integration-tests/error-handling.test.ts" name="Integration: Error Handling > Scenario 3: Task failure and downstream skipping" time="0.003344604">
|
|
187
|
+
</testcase>
|
|
188
|
+
<testcase classname="tests/integration-tests/error-handling.test.ts" name="Integration: Error Handling > Scenario 10: Circular dependency detection" time="0.002707284">
|
|
189
|
+
</testcase>
|
|
190
|
+
<testcase classname="tests/integration-tests/error-handling.test.ts" name="Integration: Error Handling > Scenario 11: Missing dependency handling" time="0.000328242">
|
|
191
|
+
</testcase>
|
|
192
|
+
</testsuite>
|
|
193
|
+
<testsuite name="tests/integration-tests/stress.test.ts" timestamp="2026-01-18T18:12:39.238Z" hostname="runnervmmtnos" tests="1" failures="0" errors="0" skipped="0" time="0.006101942">
|
|
194
|
+
<testcase classname="tests/integration-tests/stress.test.ts" name="Integration: Stress Tests > Scenario 5: Large graph execution (e.g., 20+ nodes)" time="0.004457772">
|
|
101
195
|
</testcase>
|
|
102
196
|
</testsuite>
|
|
103
197
|
</testsuites>
|
package/GEMINI.md
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
# task-runner Development Guidelines
|
|
2
|
-
|
|
3
|
-
Auto-generated from all feature plans. Last updated: 2026-01-17
|
|
4
|
-
|
|
5
|
-
## Active Technologies
|
|
6
|
-
- TypeScript 5.9.3 + vitest 4.0.17 (for testing) (004-pre-execution-validation)
|
|
7
|
-
- TypeScript 5.9.3 + vitest 4.0.17, AbortSignal/AbortController (standard Web APIs) (002-task-cancellation)
|
|
8
|
-
- N/A (in-memory context object) (002-task-cancellation)
|
|
9
|
-
- N/A (in-memory queue for tasks) (005-concurrency-control)
|
|
10
|
-
|
|
11
|
-
- TypeScript 5.9.3 + vitest 4.0.17 (003-refactor-file-structure)
|
|
12
|
-
|
|
13
|
-
- (001-generic-task-runner)
|
|
14
|
-
|
|
15
|
-
## Project Structure
|
|
16
|
-
|
|
17
|
-
```text
|
|
18
|
-
src/
|
|
19
|
-
tests/
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
## Commands
|
|
23
|
-
|
|
24
|
-
# Add commands for
|
|
25
|
-
|
|
26
|
-
## Code Style
|
|
27
|
-
|
|
28
|
-
: Follow standard conventions
|
|
29
|
-
|
|
30
|
-
## Recent Changes
|
|
31
|
-
- 005-concurrency-control: Added TypeScript 5.9.3 + vitest 4.0.17
|
|
32
|
-
- 002-task-cancellation: Added TypeScript 5.9.3 + vitest 4.0.17, AbortSignal/AbortController (standard Web APIs)
|
|
33
|
-
- 004-pre-execution-validation: Added TypeScript 5.9.3 + vitest 4.0.17 (for testing)
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
<!-- MANUAL ADDITIONS START -->
|
|
38
|
-
- Never edit CHANGELOG.md manually. This file is for semantic release and is filled automatically.
|
|
39
|
-
|
|
40
|
-
Before marking a task as concluded, YOU MUST:
|
|
41
|
-
|
|
42
|
-
1. run pnpm install
|
|
43
|
-
2. run pnpm build
|
|
44
|
-
3. run pnpm test
|
|
45
|
-
4. run pnpm lint
|
|
46
|
-
|
|
47
|
-
If any of those command fail, review your changes.
|
|
48
|
-
<!-- MANUAL ADDITIONS END -->
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
## Implementation
|
|
2
|
-
- [ ] 1.1 Update `TaskRunner.execute` signature to accept an optional config object.
|
|
3
|
-
- [ ] 1.2 Implement logic within `TaskRunner` to listen for `AbortSignal` and initiate cancellation.
|
|
4
|
-
- [ ] 1.3 Implement global timeout mechanism using `AbortController` and `setTimeout`.
|
|
5
|
-
- [ ] 1.4 Propagate `AbortSignal` to individual `TaskStep` executions.
|
|
6
|
-
- [ ] 1.5 Ensure `TaskRunner` correctly handles tasks that are already aborted before execution.
|
|
7
|
-
- [ ] 1.6 Update `TaskResult` and `RunnerEvents` to reflect cancellation status.
|
|
8
|
-
- [ ] 1.7 Add unit tests for `AbortSignal` cancellation scenarios.
|
|
9
|
-
- [ ] 1.8 Add unit tests for global timeout scenarios.
|
|
10
|
-
- [ ] 1.9 Add integration tests covering both `AbortSignal` and timeout interactions.
|