feat(tui): TuiMaterializer A2A integration layer #10793

Closed
HAL9000 wants to merge 8 commits from feature/m694-tui-materializer-a2a-integration-layer into master

8 Commits

Author SHA1 Message Date
drew c10b8e85cd fix(tui): align materializer A2A steps with current event models
CI / load-versions (pull_request) Successful in 17s
CI / push-validation (pull_request) Successful in 26s
CI / lint (pull_request) Successful in 52s
CI / typecheck (pull_request) Successful in 1m17s
CI / security (pull_request) Successful in 1m23s
CI / quality (pull_request) Successful in 57s
CI / build (pull_request) Successful in 42s
CI / helm (pull_request) Successful in 54s
CI / unit_tests (pull_request) Successful in 6m52s
CI / integration_tests (pull_request) Successful in 11m6s
CI / docker (pull_request) Successful in 1m57s
CI / coverage (pull_request) Successful in 11m10s
CI / status-check (pull_request) Successful in 3s
2026-06-16 17:21:25 -04:00
HAL9000 3829cf2b33 fix(tui): resolve ambiguous step and TUI error scenario step mismatch
Rename @then("the output should be valid JSON") to
@then("the materializer output should be valid JSON") to eliminate
the AmbiguousStep collision with cli_output_formats_steps.py:238
that caused all 32 Behave worker chunks to error at load time.

Also add @then("a TUI error A2A event should be created") for the
Handle TUI error adapter scenario, which was incorrectly reusing
the output-event step that asserts event_type == "tui_output" —
error events use context.error_event with event_type == "tui_error".

ISSUES CLOSED: #10793
2026-06-16 17:11:54 -04:00
controller-ci-rerun 74c768202b chore: re-trigger CI [controller] 2026-06-16 17:11:54 -04:00
HAL9000 2a952dd81c fix(tui): strengthen response status assertion in TUI A2A integration steps
Replace weak 'result is not None' check with comprehensive field validation
for tui_events and tui_output in the A2A adapter response result.

Addresses reviewer feedback from PR #10793: step_verify_response_status
was only checking result presence, not actual response content.

ISSUES CLOSED: #10793
2026-06-16 17:11:54 -04:00
HAL9000 12babda94e fix(tui): Add missing Behave step definitions for TUI A2A integration tests
Add the 7 missing step definitions that caused unit_tests CI gate to fail:
- "the event should contain the element ID" (element_closed scenario)
- "the session should be marked as inactive" (session_end scenario)
- "the event handler should be called if provided" (emit event scenario)
- "the event queue should be cleared" (get_pending_events scenario)
- "I check the adapter state" (initialize adapter scenario)
- "the adapter should have an integration instance" (initialize adapter scenario)
- Fix "the response should contain TUI output" to handle both integration and adapter response contexts

Also fix TuiA2aIntegration.create_response() to produce a valid A2aResponse when status != "success" by using A2aErrorDetail instead of result=None, which violated the A2aResponse model validator.
2026-06-16 17:11:54 -04:00
HAL9000 deb1bf79d3 fix(tui): Apply ruff format to TUI materializer files 2026-06-16 17:11:54 -04:00
HAL9000 8005f9c937 fix(tui): Fix A2A event and response attribute references in tests
- Changed A2aEvent attribute references from .type to .event_type
- Changed A2aResponse attribute references from .data to .result
- Changed response status check from .status to .result is not None
- These fixes align with the actual A2A model definitions

Fixes failing unit tests in tui_materializer_a2a_integration feature
2026-06-16 17:11:42 -04:00
HAL9000 2e8d589dff feat(tui): TuiMaterializer A2A integration layer
Implement TuiMaterializer class that integrates TUI output with the A2A
(Agent-to-Agent) communication system, enabling structured output streaming
and event-based communication between agents.

- Add TuiMaterializer class implementing MaterializationStrategy protocol
- Add TuiA2aIntegration class for converting TUI events to A2A events
- Add TuiA2aAdapter class for bridging TUI output and A2A infrastructure
- Add comprehensive Behave tests for all components
- Support event buffering, serialization, and A2A response creation
- Implement lazy imports to avoid circular dependencies
2026-06-16 17:11:27 -04:00