Skip to content

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

Merged
Kaap10 merged 1 commit into
codeforstartups:developmentfrom
Ashishds:feat/dynaflow-control-flow-clean
Oct 13, 2026
Merged

Kaap10 merged 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

@Kaap10 Kaap10 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. The graph orchestration runtime cleanly implements state reducers, safe expression routing without eval, parallel barrier execution, and bounded loop controls. Tested end-to-end with all unit tests and CI checks passing.

@Kaap10
Kaap10 merged commit 5f077d3 into codeforstartups:development Oct 13, 2026
4 checks passed
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.

2 participants