Skip to content

test(flow): ADK LLM Auditor compilation and execution tests#219

Merged
atemate merged 9 commits intomainfrom
1c8d/1flmd6.test-adk-llm-auditor-compilation-execution-test
Feb 27, 2026
Merged

test(flow): ADK LLM Auditor compilation and execution tests#219
atemate merged 9 commits intomainfrom
1c8d/1flmd6.test-adk-llm-auditor-compilation-execution-test

Conversation

@atemate
Copy link
Copy Markdown
Collaborator

@atemate atemate commented Feb 26, 2026

Summary

  • Add 6 component tests for the flow compiler covering the ADK LLM Auditor (async sequential) and ReAct (while-loop) patterns
  • Tests validate parsing, compilation, and execution of generated routers against VFS
  • Closes task 1c8d/1flmd6

Tests Added

Test What it validates
test_parse_sequential_async Parser detects async def, extracts 2 ActorCall IR nodes (critic, reviser)
test_compile_sequential_async Compiler generates start_llm_auditor_flow / end_llm_auditor_flow with correct actor routing
test_execute_sequential_async Compiled router writes ["critic", "reviser"] to VFS route/next
test_compile_react_loop Compiler generates 4 routers: start, conditional (_if), loop_back, end
test_execute_react_loop_no_tools Conditional router skips execute-tool when tool_calls is empty
test_execute_react_loop_with_tools Conditional router routes to execute-tool when tool_calls present

Test plan

  • All 6 new tests pass (make -C testing/component/flow-compiler test -k test_adk)
  • No regressions — pre-existing failures unchanged (19 in test_dotgen and test_routing_correctness)
  • Lint passes

@github-actions github-actions Bot added the test label Feb 26, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds a comprehensive set of component tests for the flow compiler, covering async sequential and ReAct loop patterns. The tests are well-structured and validate parsing, compilation, and execution. I've provided a few suggestions to improve code consistency, readability, and reduce duplication in the new test file, aligning with established practices for test maintainability.

Comment thread testing/component/flow-compiler/tests/test_adk_llm_auditor.py
Comment thread testing/component/flow-compiler/tests/test_adk_llm_auditor.py Outdated
Comment thread testing/component/flow-compiler/tests/test_adk_llm_auditor.py Outdated
@github-actions github-actions Bot added the ci Changes in CI label Feb 26, 2026
… 1flmd6)

Add 6 component tests covering async sequential flow (ADK LLM Auditor
pattern) and ReAct while-loop pattern:
- test_parse_sequential_async: verify parser detects async and extracts ActorCall IR
- test_compile_sequential_async: verify start/end routers with critic+reviser
- test_execute_sequential_async: verify VFS route output matches expected actors
- test_compile_react_loop: verify 4 routers (start, if, loop_back, end)
- test_execute_react_loop_no_tools: verify conditional skips execute-tool
- test_execute_react_loop_with_tools: verify conditional routes to execute-tool
- Use pathlib instead of os.path in VFS helpers for consistency
- Use next() instead of list comprehension + [0] for first-match lookups
- Extract shared setup into _run_react_loop_if_router helper
- Remove unused os import
Add flow-compiler to the component-tests matrix in ci.yml so
test_adk_llm_auditor.py (and other flow-compiler tests) run in CI.

- Add test-one target to flow-compiler Makefile as CI-compatible alias
- Add matrix entry with dummy config (pure Python, no Docker needed)
Add adk_llm_auditor.py - a realistic async agentic flow that exercises
ALL flow DSL syntax capabilities in a single flow:
- async def + await, class instantiation + method calls
- while True loop with break, continue, and max-iteration guard
- try-except for resilient LLM generation
- fan-out: parallel scoring by two independent LLMs (list literal)
- if/elif/else with nested conditionals
- early return guard clause, payload mutations

Compiles to 20 routers. Add 9 new tests (15 total in file) covering:
- IR parsing: all node types present (ActorCall, WhileLoop, FanOutCall,
  TryExcept, Condition, Break, Continue, Mutation, Return)
- Compilation: router count, structure, valid Python output
- Execution: init mutations, no-claims exit, loop entry, approved/
  standard-revision/deep-revision/continue-marginal decision branches
The adk_llm_auditor flow uses while-True loops, which trigger the
pre-existing DOT visualization bug where body actors render as
dead-end nodes without edges back to the loop_back router.
@atemate atemate force-pushed the 1c8d/1flmd6.test-adk-llm-auditor-compilation-execution-test branch from 69f376b to 5c645b2 Compare February 26, 2026 18:00
atemate and others added 4 commits February 27, 2026 14:45
… optimizations

After merging main, the compiler now inlines mutations into start
routers and uses VFS-based routing. Update tests to match:
- test_routing_correctness: rewrite to use VFS temp dirs instead of
  message-based routing, set env vars before exec for resolve()
- test_adk_llm_auditor: test start_llm_auditor instead of removed
  router_llm_auditor_line_29_seq
- test_dotgen: update color assertions (darkseagreen4/indianred4),
  fix truncation test for unicode ellipsis, replace _center_text
  tests with _truncate_display_name
- test_complex_flows: mutations_only.py now compiles to 2 routers
- Recompile adk_llm_auditor example with updated compiler
The CI graphviz installation may lack PNG rendering libraries
(libgd/cairo). The generate_plot tests now gracefully handle
RuntimeError from dot -Tpng and fall back to DOT file assertions.
The test_sla_precheck_stops_retries test fails intermittently in CI
due to SQS latency jitter with a tight 5s deadline. Increasing to 8s
gives 3s more headroom while still testing the same behavior: SLA
expiry stops retries before max_attempts (4 of 5 attempts execute).
@atemate atemate merged commit d77facc into main Feb 27, 2026
32 of 33 checks passed
@atemate atemate deleted the 1c8d/1flmd6.test-adk-llm-auditor-compilation-execution-test branch February 27, 2026 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Changes in CI test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant