Skip to content

[Flow Validate] Detect references to future steps in the same flow #75

@ameet

Description

@ameet

Summary

one --agent flow validate should detect references to steps that run later in the same flow.

Problem

It is easy to write a flow that references $.steps.someLaterStep from an earlier step. That dependency is impossible at runtime, but today it can slip through because the flow is syntactically valid.

Examples of the kinds of mistakes this would catch:

  • a code step reading a future step's output
  • a flow input selector referencing a future sibling step
  • a module-backed code step depending on a later persistence/render step

Requested behavior

During validation, flag same-flow references where a step depends on a later step in execution order.

Ideally this would work for:

  • inline code.source
  • external code.module files
  • selectors inside step config such as flow inputs, file-write content, action data, and conditions

Validation UX

A useful error would include:

  • the flow key
  • the consumer step id
  • the referenced future step id
  • the location or source field where the reference was found

Why this would help

These are high-signal bugs because they are impossible dependencies, not ambiguous style issues.

Catching them in flow validate would prevent a whole class of silent runtime bugs and make complex orchestration flows much safer to evolve.

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