Skip to content

Generated builder for a nested local flow cannot build its children (root segment duplicated) #19

Closed

Description

@rinekri

A generated node builder for a local flow nested inside another flow cannot build its own children. The child target resolves with the flow's root segment twice, so the builder's when never matches and it throws.

Repro (master)

digraph DslParityApp {
  package = "ru.kode.way.dslparity"

  app [type = flow, parameterName = timeout, parameterType = "kotlin.Int"]
  settings [type = flow, resultType = "kotlin.String"]

  app -> intro
  app -> settings -> general
}

Navigate app -> settings -> general. Building general fails:

java.lang.IllegalStateException: illegal path build requested for "settings" node: settings.general
  at ru.kode.way.dslparity.SettingsNodeBuilder.build(SettingsNodeBuilder.kt:34)
  at ru.kode.way.dslparity.AppNodeBuilder.build(AppNodeBuilder.kt:58)
  at ru.kode.way.TransitionNodeBuilder.build(NavigationService.kt:1110)
  at ru.kode.way.NavigationService.synchronizeNodes(NavigationService.kt:835)

Cause

In the generated SettingsNodeBuilder.build, the root path is settings. Its child branch compares against targetOrError(Segment("general@..."), rootSegmentAlias), which goes through schema.target(...) and returns the full target from the schema root's point of view. Under the settings alias it resolves to settings.settings.general, but the requested path is settings.general, so no branch matches and else -> error(...) throws.

The generated targets for nodes inside a local (non-schema) flow seem to carry the flow's own segment, and the alias then adds it a second time. Builders for included schemas (type = schema) are not affected.

Workaround

The DSL parity test in #18 builds this one flow's NodeBuilder by hand on the generated side.

Activity

  1. added a commit that references this issue on Nov 9, 2026
    1d25d49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions