@calmo/task-runner 2.0.0 → 3.0.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.
Files changed (83) hide show
  1. package/AGENTS.md +49 -0
  2. package/CHANGELOG.md +21 -0
  3. package/README.md +1 -1
  4. package/coverage/coverage-final.json +8 -4
  5. package/coverage/index.html +24 -9
  6. package/coverage/lcov-report/index.html +24 -9
  7. package/coverage/lcov-report/src/EventBus.ts.html +8 -8
  8. package/coverage/lcov-report/src/TaskGraphValidator.ts.html +53 -53
  9. package/coverage/lcov-report/src/TaskRunner.ts.html +213 -21
  10. package/coverage/lcov-report/src/TaskRunnerBuilder.ts.html +313 -0
  11. package/coverage/lcov-report/src/TaskRunnerExecutionConfig.ts.html +124 -0
  12. package/coverage/lcov-report/src/TaskStateManager.ts.html +511 -0
  13. package/coverage/lcov-report/src/WorkflowExecutor.ts.html +119 -137
  14. package/coverage/lcov-report/src/contracts/RunnerEvents.ts.html +1 -1
  15. package/coverage/lcov-report/src/contracts/index.html +1 -1
  16. package/coverage/lcov-report/src/index.html +57 -12
  17. package/coverage/lcov-report/src/strategies/StandardExecutionStrategy.ts.html +190 -0
  18. package/coverage/lcov-report/src/strategies/index.html +116 -0
  19. package/coverage/lcov.info +381 -204
  20. package/coverage/src/EventBus.ts.html +8 -8
  21. package/coverage/src/TaskGraphValidator.ts.html +53 -53
  22. package/coverage/src/TaskRunner.ts.html +213 -21
  23. package/coverage/src/TaskRunnerBuilder.ts.html +313 -0
  24. package/coverage/src/TaskRunnerExecutionConfig.ts.html +124 -0
  25. package/coverage/src/TaskStateManager.ts.html +511 -0
  26. package/coverage/src/WorkflowExecutor.ts.html +119 -137
  27. package/coverage/src/contracts/RunnerEvents.ts.html +1 -1
  28. package/coverage/src/contracts/index.html +1 -1
  29. package/coverage/src/index.html +57 -12
  30. package/coverage/src/strategies/StandardExecutionStrategy.ts.html +190 -0
  31. package/coverage/src/strategies/index.html +116 -0
  32. package/dist/TaskRunner.d.ts +12 -2
  33. package/dist/TaskRunner.js +55 -3
  34. package/dist/TaskRunner.js.map +1 -1
  35. package/dist/TaskRunnerBuilder.d.ts +33 -0
  36. package/dist/TaskRunnerBuilder.js +54 -0
  37. package/dist/TaskRunnerBuilder.js.map +1 -0
  38. package/dist/TaskRunnerExecutionConfig.d.ts +13 -0
  39. package/dist/TaskRunnerExecutionConfig.js +2 -0
  40. package/dist/TaskRunnerExecutionConfig.js.map +1 -0
  41. package/dist/TaskStateManager.d.ts +54 -0
  42. package/dist/TaskStateManager.js +130 -0
  43. package/dist/TaskStateManager.js.map +1 -0
  44. package/dist/TaskStatus.d.ts +1 -1
  45. package/dist/TaskStep.d.ts +2 -1
  46. package/dist/WorkflowExecutor.d.ts +11 -17
  47. package/dist/WorkflowExecutor.js +67 -69
  48. package/dist/WorkflowExecutor.js.map +1 -1
  49. package/dist/index.d.ts +4 -0
  50. package/dist/index.js +3 -0
  51. package/dist/index.js.map +1 -1
  52. package/dist/strategies/IExecutionStrategy.d.ts +16 -0
  53. package/dist/strategies/IExecutionStrategy.js +2 -0
  54. package/dist/strategies/IExecutionStrategy.js.map +1 -0
  55. package/dist/strategies/StandardExecutionStrategy.d.ts +9 -0
  56. package/dist/strategies/StandardExecutionStrategy.js +25 -0
  57. package/dist/strategies/StandardExecutionStrategy.js.map +1 -0
  58. package/openspec/changes/add-concurrency-control/proposal.md +14 -0
  59. package/openspec/changes/add-concurrency-control/tasks.md +9 -0
  60. package/openspec/changes/add-task-retry-policy/proposal.md +13 -0
  61. package/openspec/changes/add-task-retry-policy/tasks.md +10 -0
  62. package/openspec/changes/add-workflow-preview/proposal.md +12 -0
  63. package/openspec/changes/add-workflow-preview/tasks.md +7 -0
  64. package/openspec/changes/archive/2026-01-18-add-external-task-cancellation/tasks.md +10 -0
  65. package/openspec/changes/archive/2026-01-18-add-integration-tests/proposal.md +18 -0
  66. package/openspec/changes/archive/2026-01-18-add-integration-tests/tasks.md +17 -0
  67. package/openspec/changes/archive/2026-01-18-refactor-core-architecture/proposal.md +14 -0
  68. package/openspec/changes/archive/2026-01-18-refactor-core-architecture/tasks.md +8 -0
  69. package/package.json +1 -1
  70. package/src/TaskRunner.ts +68 -4
  71. package/src/TaskRunnerBuilder.ts +76 -0
  72. package/src/TaskRunnerExecutionConfig.ts +13 -0
  73. package/src/TaskStateManager.ts +142 -0
  74. package/src/TaskStatus.ts +1 -1
  75. package/src/TaskStep.ts +2 -1
  76. package/src/WorkflowExecutor.ts +77 -83
  77. package/src/index.ts +4 -0
  78. package/src/strategies/IExecutionStrategy.ts +21 -0
  79. package/src/strategies/StandardExecutionStrategy.ts +35 -0
  80. package/test-report.xml +119 -45
  81. package/GEMINI.md +0 -48
  82. package/openspec/changes/add-external-task-cancellation/tasks.md +0 -10
  83. /package/openspec/changes/{add-external-task-cancellation → archive/2026-01-18-add-external-task-cancellation}/proposal.md +0 -0
package/test-report.xml CHANGED
@@ -1,7 +1,7 @@
1
1
  <?xml version="1.0" encoding="UTF-8" ?>
2
- <testsuites name="vitest tests" tests="36" failures="0" errors="0" time="0.286169223">
3
- <testsuite name="tests/ComplexScenario.test.ts" timestamp="2026-01-18T15:13:46.722Z" hostname="runnervmmtnos" tests="2" failures="0" errors="0" skipped="0" time="0.009123917">
4
- <testcase classname="tests/ComplexScenario.test.ts" name="Complex Scenario Integration Tests &gt; 1. All steps execute when all succeed and context is hydrated" time="0.005950364">
2
+ <testsuites name="vitest tests" tests="66" failures="0" errors="0" time="0.734267979">
3
+ <testsuite name="tests/ComplexScenario.test.ts" timestamp="2026-01-18T16:53:50.036Z" hostname="runnervmmtnos" tests="2" failures="0" errors="0" skipped="0" time="0.012401489">
4
+ <testcase classname="tests/ComplexScenario.test.ts" name="Complex Scenario Integration Tests &gt; 1. All steps execute when all succeed and context is hydrated" time="0.007855447">
5
5
  <system-out>
6
6
  Running StepA
7
7
  Running StepB
@@ -15,89 +15,163 @@ Running StepG
15
15
 
16
16
  </system-out>
17
17
  </testcase>
18
- <testcase classname="tests/ComplexScenario.test.ts" name="Complex Scenario Integration Tests &gt; 2. The &apos;skip&apos; propagation works as intended if something breaks up in the tree" time="0.001176806">
18
+ <testcase classname="tests/ComplexScenario.test.ts" name="Complex Scenario Integration Tests &gt; 2. The &apos;skip&apos; propagation works as intended if something breaks up in the tree" time="0.002288234">
19
19
  </testcase>
20
20
  </testsuite>
21
- <testsuite name="tests/EventBus.test.ts" timestamp="2026-01-18T15:13:46.724Z" hostname="runnervmmtnos" tests="1" failures="0" errors="0" skipped="0" time="0.019297461">
22
- <testcase classname="tests/EventBus.test.ts" name="EventBus &gt; should handle async listeners throwing errors without crashing" time="0.017335491">
21
+ <testsuite name="tests/EventBus.test.ts" timestamp="2026-01-18T16:53:50.037Z" hostname="runnervmmtnos" tests="1" failures="0" errors="0" skipped="0" time="0.021934861">
22
+ <testcase classname="tests/EventBus.test.ts" name="EventBus &gt; should handle async listeners throwing errors without crashing" time="0.019540929">
23
23
  </testcase>
24
24
  </testsuite>
25
- <testsuite name="tests/TaskGraphValidator.test.ts" timestamp="2026-01-18T15:13:46.724Z" hostname="runnervmmtnos" tests="9" failures="0" errors="0" skipped="0" time="0.008829958">
26
- <testcase classname="tests/TaskGraphValidator.test.ts" name="TaskGraphValidator &gt; should be instantiated" time="0.001727303">
25
+ <testsuite name="tests/TaskGraphValidator.test.ts" timestamp="2026-01-18T16:53:50.038Z" hostname="runnervmmtnos" tests="9" failures="0" errors="0" skipped="0" time="0.009766435">
26
+ <testcase classname="tests/TaskGraphValidator.test.ts" name="TaskGraphValidator &gt; should be instantiated" time="0.002042233">
27
27
  </testcase>
28
- <testcase classname="tests/TaskGraphValidator.test.ts" name="TaskGraphValidator &gt; should return valid result for empty graph" time="0.001258177">
28
+ <testcase classname="tests/TaskGraphValidator.test.ts" name="TaskGraphValidator &gt; should return valid result for empty graph" time="0.001433754">
29
29
  </testcase>
30
- <testcase classname="tests/TaskGraphValidator.test.ts" name="TaskGraphValidator &gt; should detect duplicate tasks" time="0.001873847">
30
+ <testcase classname="tests/TaskGraphValidator.test.ts" name="TaskGraphValidator &gt; should detect duplicate tasks" time="0.001395153">
31
31
  </testcase>
32
- <testcase classname="tests/TaskGraphValidator.test.ts" name="TaskGraphValidator &gt; should detect missing dependencies" time="0.000404865">
32
+ <testcase classname="tests/TaskGraphValidator.test.ts" name="TaskGraphValidator &gt; should detect missing dependencies" time="0.000435706">
33
33
  </testcase>
34
- <testcase classname="tests/TaskGraphValidator.test.ts" name="TaskGraphValidator &gt; should detect cycles" time="0.000448717">
34
+ <testcase classname="tests/TaskGraphValidator.test.ts" name="TaskGraphValidator &gt; should detect cycles" time="0.000776113">
35
35
  </testcase>
36
- <testcase classname="tests/TaskGraphValidator.test.ts" name="TaskGraphValidator &gt; should return valid for a correct graph" time="0.000404856">
36
+ <testcase classname="tests/TaskGraphValidator.test.ts" name="TaskGraphValidator &gt; should return valid for a correct graph" time="0.000369241">
37
37
  </testcase>
38
- <testcase classname="tests/TaskGraphValidator.test.ts" name="TaskGraphValidator &gt; should not detect cycles if missing dependencies are present" time="0.000360703">
38
+ <testcase classname="tests/TaskGraphValidator.test.ts" name="TaskGraphValidator &gt; should not detect cycles if missing dependencies are present" time="0.000350526">
39
39
  </testcase>
40
- <testcase classname="tests/TaskGraphValidator.test.ts" name="TaskGraphValidator &gt; should detect more complex cycles" time="0.000276827">
40
+ <testcase classname="tests/TaskGraphValidator.test.ts" name="TaskGraphValidator &gt; should detect more complex cycles" time="0.000261449">
41
41
  </testcase>
42
- <testcase classname="tests/TaskGraphValidator.test.ts" name="TaskGraphValidator &gt; should handle cycle detection with no cycles but shared dependencies" time="0.000241571">
42
+ <testcase classname="tests/TaskGraphValidator.test.ts" name="TaskGraphValidator &gt; should handle cycle detection with no cycles but shared dependencies" time="0.000339385">
43
43
  </testcase>
44
44
  </testsuite>
45
- <testsuite name="tests/TaskGraphValidatorDoS.test.ts" timestamp="2026-01-18T15:13:46.726Z" hostname="runnervmmtnos" tests="1" failures="0" errors="0" skipped="0" time="0.049329936">
46
- <testcase classname="tests/TaskGraphValidatorDoS.test.ts" name="TaskGraphValidator - Deep Recursion &gt; should handle deep graphs without stack overflow" time="0.047337509">
45
+ <testsuite name="tests/TaskGraphValidatorDoS.test.ts" timestamp="2026-01-18T16:53:50.040Z" hostname="runnervmmtnos" tests="1" failures="0" errors="0" skipped="0" time="0.037493531">
46
+ <testcase classname="tests/TaskGraphValidatorDoS.test.ts" name="TaskGraphValidator - Deep Recursion &gt; should handle deep graphs without stack overflow" time="0.035728917">
47
47
  </testcase>
48
48
  </testsuite>
49
- <testsuite name="tests/TaskRunner.test.ts" timestamp="2026-01-18T15:13:46.727Z" hostname="runnervmmtnos" tests="10" failures="0" errors="0" skipped="0" time="0.112220851">
50
- <testcase classname="tests/TaskRunner.test.ts" name="TaskRunner &gt; should run tasks in the correct sequential order" time="0.0038045">
49
+ <testsuite name="tests/TaskRunner.test.ts" timestamp="2026-01-18T16:53:50.040Z" hostname="runnervmmtnos" tests="10" failures="0" errors="0" skipped="0" time="0.111490101">
50
+ <testcase classname="tests/TaskRunner.test.ts" name="TaskRunner &gt; should run tasks in the correct sequential order" time="0.003037407">
51
51
  </testcase>
52
- <testcase classname="tests/TaskRunner.test.ts" name="TaskRunner &gt; should handle an empty list of tasks gracefully" time="0.000635346">
52
+ <testcase classname="tests/TaskRunner.test.ts" name="TaskRunner &gt; should handle an empty list of tasks gracefully" time="0.000322775">
53
53
  </testcase>
54
- <testcase classname="tests/TaskRunner.test.ts" name="TaskRunner &gt; should run independent tasks in parallel" time="0.100728925">
54
+ <testcase classname="tests/TaskRunner.test.ts" name="TaskRunner &gt; should run independent tasks in parallel" time="0.100688769">
55
55
  </testcase>
56
- <testcase classname="tests/TaskRunner.test.ts" name="TaskRunner &gt; should skip dependent tasks if a root task fails" time="0.000416347">
56
+ <testcase classname="tests/TaskRunner.test.ts" name="TaskRunner &gt; should skip dependent tasks if a root task fails" time="0.000418764">
57
57
  </testcase>
58
- <testcase classname="tests/TaskRunner.test.ts" name="TaskRunner &gt; should throw an error for &apos;circular dependency&apos;" time="0.002357119">
58
+ <testcase classname="tests/TaskRunner.test.ts" name="TaskRunner &gt; should throw an error for &apos;circular dependency&apos;" time="0.00237658">
59
59
  </testcase>
60
- <testcase classname="tests/TaskRunner.test.ts" name="TaskRunner &gt; should throw an error for &apos;missing dependency&apos;" time="0.000314708">
60
+ <testcase classname="tests/TaskRunner.test.ts" name="TaskRunner &gt; should throw an error for &apos;missing dependency&apos;" time="0.00042754">
61
61
  </testcase>
62
- <testcase classname="tests/TaskRunner.test.ts" name="TaskRunner &gt; should handle tasks that throw an error during execution" time="0.000313525">
62
+ <testcase classname="tests/TaskRunner.test.ts" name="TaskRunner &gt; should handle tasks that throw an error during execution" time="0.000402213">
63
63
  </testcase>
64
- <testcase classname="tests/TaskRunner.test.ts" name="TaskRunner &gt; should skip tasks whose dependencies are skipped" time="0.00036969">
64
+ <testcase classname="tests/TaskRunner.test.ts" name="TaskRunner &gt; should skip tasks whose dependencies are skipped" time="0.000513091">
65
65
  </testcase>
66
- <testcase classname="tests/TaskRunner.test.ts" name="TaskRunner &gt; should handle tasks that throw a non-Error object during execution" time="0.000305942">
66
+ <testcase classname="tests/TaskRunner.test.ts" name="TaskRunner &gt; should handle tasks that throw a non-Error object during execution" time="0.000398907">
67
67
  </testcase>
68
- <testcase classname="tests/TaskRunner.test.ts" name="TaskRunner &gt; should handle duplicate steps where one gets skipped due to failed dependency" time="0.000409565">
68
+ <testcase classname="tests/TaskRunner.test.ts" name="TaskRunner &gt; should handle duplicate steps where one gets skipped due to failed dependency" time="0.00050197">
69
69
  </testcase>
70
70
  </testsuite>
71
- <testsuite name="tests/TaskRunnerEvents.test.ts" timestamp="2026-01-18T15:13:46.729Z" hostname="runnervmmtnos" tests="7" failures="0" errors="0" skipped="0" time="0.020279996">
72
- <testcase classname="tests/TaskRunnerEvents.test.ts" name="TaskRunner Events &gt; should fire all lifecycle events in a successful run" time="0.007839309">
71
+ <testsuite name="tests/TaskRunnerEvents.test.ts" timestamp="2026-01-18T16:53:50.042Z" hostname="runnervmmtnos" tests="7" failures="0" errors="0" skipped="0" time="0.01911567">
72
+ <testcase classname="tests/TaskRunnerEvents.test.ts" name="TaskRunner Events &gt; should fire all lifecycle events in a successful run" time="0.00764296">
73
73
  </testcase>
74
- <testcase classname="tests/TaskRunnerEvents.test.ts" name="TaskRunner Events &gt; should fire taskSkipped event when dependency fails" time="0.005329486">
74
+ <testcase classname="tests/TaskRunnerEvents.test.ts" name="TaskRunner Events &gt; should fire taskSkipped event when dependency fails" time="0.005221716">
75
75
  </testcase>
76
- <testcase classname="tests/TaskRunnerEvents.test.ts" name="TaskRunner Events &gt; should not crash if a listener throws an error" time="0.001806131">
76
+ <testcase classname="tests/TaskRunnerEvents.test.ts" name="TaskRunner Events &gt; should not crash if a listener throws an error" time="0.001525195">
77
77
  </testcase>
78
- <testcase classname="tests/TaskRunnerEvents.test.ts" name="TaskRunner Events &gt; should fire workflow events even for empty step list" time="0.000492118">
78
+ <testcase classname="tests/TaskRunnerEvents.test.ts" name="TaskRunner Events &gt; should fire workflow events even for empty step list" time="0.00055575">
79
79
  </testcase>
80
- <testcase classname="tests/TaskRunnerEvents.test.ts" name="TaskRunner Events &gt; should handle unsubscribe correctly" time="0.000713071">
80
+ <testcase classname="tests/TaskRunnerEvents.test.ts" name="TaskRunner Events &gt; should handle unsubscribe correctly" time="0.00070472">
81
81
  </testcase>
82
- <testcase classname="tests/TaskRunnerEvents.test.ts" name="TaskRunner Events &gt; should safely handle off() when no listeners exist" time="0.00075527">
82
+ <testcase classname="tests/TaskRunnerEvents.test.ts" name="TaskRunner Events &gt; should safely handle off() when no listeners exist" time="0.00037408">
83
83
  </testcase>
84
- <testcase classname="tests/TaskRunnerEvents.test.ts" name="TaskRunner Events &gt; should support multiple listeners for the same event" time="0.000722328">
84
+ <testcase classname="tests/TaskRunnerEvents.test.ts" name="TaskRunner Events &gt; should support multiple listeners for the same event" time="0.000612918">
85
85
  </testcase>
86
86
  </testsuite>
87
- <testsuite name="tests/WorkflowExecutor.test.ts" timestamp="2026-01-18T15:13:46.730Z" hostname="runnervmmtnos" tests="3" failures="0" errors="0" skipped="0" time="0.058601689">
88
- <testcase classname="tests/WorkflowExecutor.test.ts" name="WorkflowExecutor &gt; should execute steps sequentially when dependencies exist" time="0.004596878">
87
+ <testsuite name="tests/TaskRunnerRefactor.test.ts" timestamp="2026-01-18T16:53:50.043Z" hostname="runnervmmtnos" tests="6" failures="0" errors="0" skipped="0" time="0.009369642">
88
+ <testcase classname="tests/TaskRunnerRefactor.test.ts" name="TaskRunner Refactor Coverage &gt; should allow setting execution strategy" time="0.002330794">
89
89
  </testcase>
90
- <testcase classname="tests/WorkflowExecutor.test.ts" name="WorkflowExecutor &gt; should skip dependent steps if dependency fails" time="0.000424162">
90
+ <testcase classname="tests/TaskRunnerRefactor.test.ts" name="TaskRunner Refactor Coverage &gt; should allow unsubscribing from events" time="0.001040117">
91
91
  </testcase>
92
- <testcase classname="tests/WorkflowExecutor.test.ts" name="WorkflowExecutor &gt; should run independent steps in parallel" time="0.051090362">
92
+ <testcase classname="tests/TaskRunnerRefactor.test.ts" name="TaskRunner Refactor Coverage &gt; TaskStateManager.cancelAllPending should handle non-existing tasks gracefully" time="0.000549209">
93
+ </testcase>
94
+ <testcase classname="tests/TaskRunnerRefactor.test.ts" name="TaskRunner Refactor Coverage &gt; TaskRunnerBuilder should build a TaskRunner" time="0.000695793">
95
+ </testcase>
96
+ <testcase classname="tests/TaskRunnerRefactor.test.ts" name="TaskRunner Refactor Coverage &gt; TaskRunnerBuilder should build a TaskRunner with no listeners" time="0.000276137">
97
+ </testcase>
98
+ <testcase classname="tests/TaskRunnerRefactor.test.ts" name="TaskRunner Refactor Coverage &gt; WorkflowExecutor should break infinite loop if no progress can be made" time="0.002033066">
99
+ </testcase>
100
+ </testsuite>
101
+ <testsuite name="tests/WorkflowExecutor.test.ts" timestamp="2026-01-18T16:53:50.044Z" hostname="runnervmmtnos" tests="3" failures="0" errors="0" skipped="0" time="0.056872202">
102
+ <testcase classname="tests/WorkflowExecutor.test.ts" name="WorkflowExecutor &gt; should execute steps sequentially when dependencies exist" time="0.003496687">
103
+ </testcase>
104
+ <testcase classname="tests/WorkflowExecutor.test.ts" name="WorkflowExecutor &gt; should skip dependent steps if dependency fails" time="0.000477163">
105
+ </testcase>
106
+ <testcase classname="tests/WorkflowExecutor.test.ts" name="WorkflowExecutor &gt; should run independent steps in parallel" time="0.051018852">
93
107
  </testcase>
94
108
  </testsuite>
95
- <testsuite name="tests/integration.test.ts" timestamp="2026-01-18T15:13:46.731Z" hostname="runnervmmtnos" tests="3" failures="0" errors="0" skipped="0" time="0.008485415">
96
- <testcase classname="tests/integration.test.ts" name="TaskRunner Validation Integration &gt; should throw validation error with clear message for duplicate tasks" time="0.004859699">
109
+ <testsuite name="tests/cancellation.test.ts" timestamp="2026-01-18T16:53:50.045Z" hostname="runnervmmtnos" tests="10" failures="0" errors="0" skipped="0" time="0.160536321">
110
+ <testcase classname="tests/cancellation.test.ts" name="TaskRunner Cancellation &gt; should execute tasks normally without cancellation" time="0.003288668">
111
+ </testcase>
112
+ <testcase classname="tests/cancellation.test.ts" name="TaskRunner Cancellation &gt; should cancel workflow via AbortSignal" time="0.011297793">
113
+ </testcase>
114
+ <testcase classname="tests/cancellation.test.ts" name="TaskRunner Cancellation &gt; should cancel workflow via global timeout" time="0.04959712">
115
+ </testcase>
116
+ <testcase classname="tests/cancellation.test.ts" name="TaskRunner Cancellation &gt; should handle pre-aborted signal" time="0.00046518">
117
+ </testcase>
118
+ <testcase classname="tests/cancellation.test.ts" name="TaskRunner Cancellation &gt; should propagate cancellation to running task" time="0.010460564">
119
+ </testcase>
120
+ <testcase classname="tests/cancellation.test.ts" name="TaskRunner Cancellation &gt; should respect timeout over signal if timeout happens first" time="0.050041281">
121
+ </testcase>
122
+ <testcase classname="tests/cancellation.test.ts" name="TaskRunner Cancellation &gt; should handle case where timeout is set AND signal is already aborted" time="0.000498924">
123
+ </testcase>
124
+ <testcase classname="tests/cancellation.test.ts" name="TaskRunner Cancellation &gt; should cancel workflow via AbortSignal when timeout is also set" time="0.010598674">
125
+ </testcase>
126
+ <testcase classname="tests/cancellation.test.ts" name="TaskRunner Cancellation &gt; should fail task if it throws non-abort error during cancellation" time="0.01120543">
127
+ </testcase>
128
+ <testcase classname="tests/cancellation.test.ts" name="TaskRunner Cancellation &gt; should cancel task if it rejects with signal.reason" time="0.010730942">
129
+ </testcase>
130
+ </testsuite>
131
+ <testsuite name="tests/integration.test.ts" timestamp="2026-01-18T16:53:50.047Z" hostname="runnervmmtnos" tests="3" failures="0" errors="0" skipped="0" time="0.005559619">
132
+ <testcase classname="tests/integration.test.ts" name="TaskRunner Validation Integration &gt; should throw validation error with clear message for duplicate tasks" time="0.003324235">
133
+ </testcase>
134
+ <testcase classname="tests/integration.test.ts" name="TaskRunner Validation Integration &gt; should throw validation error with clear message for missing dependencies" time="0.000340878">
97
135
  </testcase>
98
- <testcase classname="tests/integration.test.ts" name="TaskRunner Validation Integration &gt; should throw validation error with clear message for missing dependencies" time="0.000630747">
136
+ <testcase classname="tests/integration.test.ts" name="TaskRunner Validation Integration &gt; should throw validation error with clear message for cycles" time="0.000324869">
99
137
  </testcase>
100
- <testcase classname="tests/integration.test.ts" name="TaskRunner Validation Integration &gt; should throw validation error with clear message for cycles" time="0.000504291">
138
+ </testsuite>
139
+ <testsuite name="tests/integration-tests/basic-structure.test.ts" timestamp="2026-01-18T16:53:50.047Z" hostname="runnervmmtnos" tests="4" failures="0" errors="0" skipped="0" time="0.13078604">
140
+ <testcase classname="tests/integration-tests/basic-structure.test.ts" name="Integration: Basic Structure &gt; Scenario 1: Basic linear workflow (A -&gt; B -&gt; C)" time="0.034031066">
141
+ </testcase>
142
+ <testcase classname="tests/integration-tests/basic-structure.test.ts" name="Integration: Basic Structure &gt; Scenario 2: Branching workflow (A -&gt; [B, C] -&gt; D)" time="0.032156516">
143
+ </testcase>
144
+ <testcase classname="tests/integration-tests/basic-structure.test.ts" name="Integration: Basic Structure &gt; Scenario 12: Complex &apos;Diamond&apos; dependency graph (A -&gt; B -&gt; D, A -&gt; C -&gt; D)" time="0.041686058">
145
+ </testcase>
146
+ <testcase classname="tests/integration-tests/basic-structure.test.ts" name="Integration: Basic Structure &gt; Scenario 14: Zero-dependency parallel burst" time="0.020922221">
147
+ </testcase>
148
+ </testsuite>
149
+ <testsuite name="tests/integration-tests/concurrency-timing.test.ts" timestamp="2026-01-18T16:53:50.048Z" hostname="runnervmmtnos" tests="3" failures="0" errors="0" skipped="0" time="0.126419406">
150
+ <testcase classname="tests/integration-tests/concurrency-timing.test.ts" name="Integration: Concurrency and Timing &gt; Scenario 6: Mixed duration tasks (verifying parallel efficiency)" time="0.053041689">
151
+ </testcase>
152
+ <testcase classname="tests/integration-tests/concurrency-timing.test.ts" name="Integration: Concurrency and Timing &gt; Scenario 7: Cancellation via AbortSignal" time="0.021208639">
153
+ </testcase>
154
+ <testcase classname="tests/integration-tests/concurrency-timing.test.ts" name="Integration: Concurrency and Timing &gt; Scenario 8: Global timeout interrupting long tasks" time="0.050030744">
155
+ </testcase>
156
+ </testsuite>
157
+ <testsuite name="tests/integration-tests/context-state.test.ts" timestamp="2026-01-18T16:53:50.049Z" hostname="runnervmmtnos" tests="3" failures="0" errors="0" skipped="0" time="0.019135968">
158
+ <testcase classname="tests/integration-tests/context-state.test.ts" name="Integration: Context and State &gt; Scenario 4: Shared context mutation (A writes, B reads)" time="0.005077797">
159
+ </testcase>
160
+ <testcase classname="tests/integration-tests/context-state.test.ts" name="Integration: Context and State &gt; Scenario 9: Dynamic context validation" time="0.000954216">
161
+ </testcase>
162
+ <testcase classname="tests/integration-tests/context-state.test.ts" name="Integration: Context and State &gt; Scenario 13: Tasks with side-effects" time="0.010823344">
163
+ </testcase>
164
+ </testsuite>
165
+ <testsuite name="tests/integration-tests/error-handling.test.ts" timestamp="2026-01-18T16:53:50.049Z" hostname="runnervmmtnos" tests="3" failures="0" errors="0" skipped="0" time="0.008227594">
166
+ <testcase classname="tests/integration-tests/error-handling.test.ts" name="Integration: Error Handling &gt; Scenario 3: Task failure and downstream skipping" time="0.003512046">
167
+ </testcase>
168
+ <testcase classname="tests/integration-tests/error-handling.test.ts" name="Integration: Error Handling &gt; Scenario 10: Circular dependency detection" time="0.002290789">
169
+ </testcase>
170
+ <testcase classname="tests/integration-tests/error-handling.test.ts" name="Integration: Error Handling &gt; Scenario 11: Missing dependency handling" time="0.000406341">
171
+ </testcase>
172
+ </testsuite>
173
+ <testsuite name="tests/integration-tests/stress.test.ts" timestamp="2026-01-18T16:53:50.050Z" hostname="runnervmmtnos" tests="1" failures="0" errors="0" skipped="0" time="0.0051591">
174
+ <testcase classname="tests/integration-tests/stress.test.ts" name="Integration: Stress Tests &gt; Scenario 5: Large graph execution (e.g., 20+ nodes)" time="0.003673567">
101
175
  </testcase>
102
176
  </testsuite>
103
177
  </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.