Skip to content

feat(agents): add dynaflow graph orchestration engine and control flow (#277, #278) - #344

Open
Ashishds wants to merge 1 commit into
codeforstartups:developmentfrom
Ashishds:feat/dynaflow-control-flow-clean
Open

Ashishds wants to merge 1 commit into
codeforstartups:developmentfrom
Ashishds:feat/dynaflow-control-flow-clean

Conversation

@Ashishds

@Ashishds Ashishds commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements the dynaflow graph orchestration engine runtime for the P1 — Orchestration engine milestone.

Changes

src/dynavec/agents/graph.py (new file)

  • GraphState — typed shared-state dict with custom field reducers and isolated branch copies for concurrent execution
  • BaseNode / FunctionNode — abstract node protocol + Python callable wrapping
  • Edge — conditional transitions with safe AST expression parser (==, !=, <, <=, >, >=, in, and, or) — no eval() used
  • add_conditional_edges() — state-driven router nodes
  • add_parallel_branches() — concurrent fan-out with ThreadPoolExecutor + join barrier synchronization
  • Bounded loops — iteration-capped with MaxIterationsExceededError runaway guards
  • Cycle detection — DFS validator; permits guarded cycles, rejects malformed infinite cycles with GraphCycleError
  • GraphResult / NodeTrace — per-node telemetry traces and timing

src/dynavec/agents/__init__.py (updated)

  • Adds all new graph orchestration symbols; fully preserves all existing exports

tests/test_flow.py (new, 10 tests)

  • Linear pipelines, state reducers, conditional branching (string + callable), parallel fan-out/join, bounded loops, max-iteration guard, cycle error validation, serialization

Test Results

@Ashishds
Ashishds force-pushed the feat/dynaflow-control-flow-clean branch from 69aec7e to 040ef15 Compare October 9, 2026 05:54

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant