@usearazzo/runner 1.0.1-alpha.37 → 1.0.1-alpha.38

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/CHANGELOG.md CHANGED
@@ -3,6 +3,12 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.0.1-alpha.38](https://github.com/usearazzo/arazzo-toolkit/compare/v1.0.1-alpha.37...v1.0.1-alpha.38) (2026-11-27)
7
+
8
+ ### Bug Fixes
9
+
10
+ - **runner:** reject a workflow without steps ([#391](https://github.com/usearazzo/arazzo-toolkit/issues/391)) ([ac3927f](https://github.com/usearazzo/arazzo-toolkit/commit/ac3927f1d3a894f348ae95f627e4558078304773)), closes [#338](https://github.com/usearazzo/arazzo-toolkit/issues/338)
11
+
6
12
  ## [1.0.1-alpha.37](https://github.com/usearazzo/arazzo-toolkit/compare/v1.0.1-alpha.36...v1.0.1-alpha.37) (2026-11-27)
7
13
 
8
14
  ### Bug Fixes
@@ -11299,7 +11299,7 @@ class ExecutionError extends _ArazzoRunnerError_ts__WEBPACK_IMPORTED_MODULE_0__[
11299
11299
  static InvalidWorkflowReference = 'invalid-workflow-reference';
11300
11300
  /** A workflow's `dependsOn` is not a list or holds a non-string entry. */
11301
11301
  static MalformedDependsOn = 'malformed-dependsOn';
11302
- /** A workflow's `steps` is not a list or holds an entry that is not a Step Object. */
11302
+ /** A workflow's `steps` is absent, empty, not a list, or holds an entry that is not a Step Object. */
11303
11303
  static MalformedSteps = 'malformed-steps';
11304
11304
  /** A step run as an operation declares neither an `operationId` nor an `operationPath`. */
11305
11305
  static MissingOperation = 'missing-operation';
@@ -14805,8 +14805,8 @@ class WorkflowExecutor {
14805
14805
  * it is named a call cycle, not a dependency one, and charged one unit
14806
14806
  * for entering the reference itself, matching the "1 for the step itself
14807
14807
  * plus whatever its sub-run spends" convention a sub-workflow step
14808
- * already follows (without it, a reference to a workflow with few or no
14809
- * steps of its own would cost nothing to fire). Its inputs are the
14808
+ * already follows (without it, a reference to a one-step workflow would
14809
+ * cost no more than that step to fire). Its inputs are the
14810
14810
  * action's `parameters` (`#115`), resolved again on every firing
14811
14811
  * against the attempt that fired it — `{}` without them. Its outputs are
14812
14812
  * recorded via `state.setWorkflow`, which *is* "context transfers back",
@@ -15428,13 +15428,24 @@ class WorkflowExecutor {
15428
15428
  }
15429
15429
 
15430
15430
  /**
15431
- * The workflow's steps as an array in list order. An absent `steps` is a
15432
- * workflow with no steps — an empty list, a completed no-op run. A present but
15433
- * malformed `steps` (not a list, or holding a non-step entry) is an authoring
15434
- * error and throws rather than being silently treated as empty or partial.
15431
+ * The workflow's steps as an array in list order. `steps` is a REQUIRED field
15432
+ * holding at least one step, and the validator reports an absent or empty one
15433
+ * as an Error, so neither runs as a completed no-op. Those, like a `steps`
15434
+ * that is not a list or holds a non-step entry, are authoring errors and
15435
+ * throw rather than being silently treated as empty or partial.
15436
+ *
15437
+ * Checked when the workflow is entered, before any of its own prerequisites
15438
+ * or steps. A workflow another one only references (a `goto` target, a retry
15439
+ * reference) is therefore rejected when the run reaches it, after the
15440
+ * requests sent on the way there.
15435
15441
  */
15436
15442
  #orderedSteps(workflow, workflowId) {
15437
- if (!workflow.hasKey('steps')) return [];
15443
+ if (!workflow.hasKey('steps')) {
15444
+ throw new _errors_ExecutionError_ts__WEBPACK_IMPORTED_MODULE_17__["default"](`workflow "${workflowId}" has no "steps"`, {
15445
+ workflowId,
15446
+ reason: _errors_ExecutionError_ts__WEBPACK_IMPORTED_MODULE_17__["default"].MalformedSteps
15447
+ });
15448
+ }
15438
15449
  const steps = workflow.steps;
15439
15450
  if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__.isArrayElement)(steps)) {
15440
15451
  throw new _errors_ExecutionError_ts__WEBPACK_IMPORTED_MODULE_17__["default"](`workflow "${workflowId}" has a non-list "steps"`, {
@@ -15442,6 +15453,12 @@ class WorkflowExecutor {
15442
15453
  reason: _errors_ExecutionError_ts__WEBPACK_IMPORTED_MODULE_17__["default"].MalformedSteps
15443
15454
  });
15444
15455
  }
15456
+ if (steps.isEmpty) {
15457
+ throw new _errors_ExecutionError_ts__WEBPACK_IMPORTED_MODULE_17__["default"](`workflow "${workflowId}" has an empty "steps"`, {
15458
+ workflowId,
15459
+ reason: _errors_ExecutionError_ts__WEBPACK_IMPORTED_MODULE_17__["default"].MalformedSteps
15460
+ });
15461
+ }
15445
15462
  return [...steps].map((step, index) => {
15446
15463
  if (!(0,_speclynx_apidom_ns_arazzo_1__WEBPACK_IMPORTED_MODULE_4__.isStepElement)(step)) {
15447
15464
  throw new _errors_ExecutionError_ts__WEBPACK_IMPORTED_MODULE_17__["default"](`workflow "${workflowId}" has a non-step entry at steps[${index}]`, {