Skip to content

[Feature] Add retry semantics to onNoConsensus transition #73

Description

@alxsuv

Problem

onFailure retry N otherwise "X" exists today (NodeBuilderTest.kt:70, wired via RetryBuilder.kt:27FailureTransition). Stochastic parallel agents can tie on first attempt and resolve on retry. Extend
the same DSL form to onNoConsensus.

Investigation (do first)

  1. onNoConsensus transition type. Determine whether it constructs a FailureTransition (shared HensuState.retryCount → cross-corruption with execution failures) or its own transition with an isolated
    counter. Source: hensu-dsl/.../ParallelNodeBuilder.kt. If alias → must split before adding retry.
  2. FailureTransition.evaluate side-effect (FailureTransition.java:16 increments inside evaluate). Decide: fix purity first, or scope-document and move on.

Implementation

  • Distinct NoConsensusTransition (or split from FailureTransition) with its own counter (consensusRetryCount on HensuState).
  • DSL: onNoConsensus retry 3 otherwise "fallback".
  • Increment counter in executor / TransitionPostProcessor, not inside evaluate.

Tests

  • Stochastic stub agents tie on attempt 1, break tie on attempt 2 → success.
  • Retry budget exhausted → routes to otherwise target.
  • Execution failure on a parallel node does NOT consume consensusRetryCount, and vice versa.

Out of scope

  • onReject retry N (rejected: deterministic reviewer → infinite loop; same input across retries provides no value).
  • Arbitrator/judge node pattern.
  • General evaluate() purity refactor across other transition types.

Metadata

Metadata

Assignees

Labels

area: coreWorkflow execution runtimearea: dslKotlin DSL compiler, workflow parsing, and script evaluationstatus: researchYou haven't written code yet. You're reading GraalVM or Quarkus docstype: featureNew feature or request

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions