UAT: A2A layer (src/cleveragents/a2a/) has zero unit tests — critical protocol layer is untested #3971

Open
opened 2026-04-06 08:03:15 +00:00 by freemo · 0 comments
Owner

Metadata

  • Branch: test/m9-a2a-layer-unit-tests
  • Commit Message: test(a2a): add Behave unit tests for entire A2A layer
  • Milestone: (none — backlog)
  • Parent Epic: #399

Backlog note: This issue was discovered during autonomous operation
on milestone v3.8.0. It does not block milestone completion and has been
placed in the backlog for human review and future milestone assignment.


Bug Report

What Was Tested

The test coverage of the A2A layer (src/cleveragents/a2a/) during UAT testing.

Expected Behavior (from spec)

Per docs/specification.md §Compliance (ADR-048):

A2A conformance tests: The server passes the A2A standard test suite for all standard methods.
Extension method tests: All _cleveragents/ methods are tested against documented parameter and response schemas.

Per the project's coverage requirement (pyproject.toml / nox -e coverage_report):

Test coverage >= 97%

The A2A layer is the sole communication protocol for all client-server interaction. It should have comprehensive unit tests (Behave/Gherkin scenarios in features/) covering:

  • A2aRequest, A2aResponse, A2aEvent model validation
  • A2aLocalFacade dispatch routing and error handling
  • SseEventFormatter SSE wire format compliance
  • A2aEventQueue publish/subscribe/close lifecycle
  • A2aVersionNegotiator version negotiation
  • ServerConnectionConfig URL validation
  • map_domain_error() error code mapping
  • ASGI app health probe responses

Actual Behavior (from test)

Running nox -e unit_tests collects zero Behave scenarios for the A2A layer. There are no .feature files under features/ for any module in src/cleveragents/a2a/.

The following files have no corresponding Behave feature files:

  • src/cleveragents/a2a/asgi.py — ASGI health probe app
  • src/cleveragents/a2a/models.py — A2A request/response/event models
  • src/cleveragents/a2a/facade.py — A2A local facade (30+ operation handlers)
  • src/cleveragents/a2a/events.py — SSE formatter and event queue
  • src/cleveragents/a2a/errors.py — Error hierarchy and domain error mapping
  • src/cleveragents/a2a/transport.py — HTTP transport stub
  • src/cleveragents/a2a/versioning.py — Version negotiation
  • src/cleveragents/a2a/server_config.py — Server connection config
  • src/cleveragents/a2a/cli_bootstrap.py — CLI facade bootstrap

Code Location

  • src/cleveragents/a2a/ — entire A2A layer (9 modules, ~1500 lines of code)
  • No corresponding Behave feature files exist anywhere in the repository for this layer

Steps to Reproduce

  1. Run nox -e unit_tests
  2. Observe: zero Behave scenarios collected for the A2A layer
  3. Run nox -e coverage_report
  4. Observe: A2A layer coverage is 0% — far below the required 97%

Impact

The A2A layer is the critical protocol boundary between the Presentation and Application layers. Without unit tests:

  • Regressions in JSON-RPC 2.0 wire format compliance will go undetected
  • SSE event formatting bugs will not be caught before deployment
  • A2A facade routing errors will not be caught
  • The 97% coverage requirement cannot be met for this layer

Suggested Fix

Create Behave feature files under features/unit/a2a/ covering:

  • a2a_models.feature — A2aRequest, A2aResponse, A2aEvent validation scenarios
  • a2a_facade.feature — A2aLocalFacade dispatch routing scenarios
  • a2a_events.feature — SseEventFormatter, A2aEventQueue scenarios
  • a2a_asgi.feature — ASGI app health probe response scenarios
  • a2a_errors.feature — Error hierarchy and domain error mapping scenarios
  • a2a_versioning.feature — Version negotiation scenarios
  • a2a_server_config.feature — ServerConnectionConfig validation scenarios

Step definitions go in features/steps/a2a/ and any test doubles in features/mocks/a2a/.


Subtasks

  • Create features/unit/a2a/a2a_models.feature — Behave scenarios for A2aRequest, A2aResponse, A2aEvent model validation
  • Create features/unit/a2a/a2a_facade.feature — Behave scenarios for A2aLocalFacade dispatch routing and error handling
  • Create features/unit/a2a/a2a_events.feature — Behave scenarios for SseEventFormatter wire format and A2aEventQueue lifecycle
  • Create features/unit/a2a/a2a_asgi.feature — Behave scenarios for ASGI health probe responses (/health, /live, /ready, /)
  • Create features/unit/a2a/a2a_errors.feature — Behave scenarios for error hierarchy and map_domain_error() code mapping
  • Create features/unit/a2a/a2a_versioning.feature — Behave scenarios for A2aVersionNegotiator version negotiation
  • Create features/unit/a2a/a2a_server_config.feature — Behave scenarios for ServerConnectionConfig URL validation
  • Create corresponding step definitions in features/steps/a2a/
  • Place all test doubles/mocks in features/mocks/a2a/ (no mocks outside this directory)
  • Run nox -e unit_tests — all scenarios pass
  • Run nox -e coverage_report — A2A layer coverage >= 97%
  • Run nox (all default sessions) — all stages pass

Definition of Done

This issue is complete when:

  • All subtasks above are completed and checked off.
  • All Behave scenarios for the A2A layer pass under nox -e unit_tests.
  • A Git commit is created where the first line of the commit message matches the Commit Message in Metadata exactly (test(a2a): add Behave unit tests for entire A2A layer), followed by a blank line, then additional lines providing relevant details about the implementation, and ending with ISSUES CLOSED: #<this issue number>.
  • The commit is pushed to the remote on the branch matching the Branch in Metadata exactly (test/m9-a2a-layer-unit-tests).
  • The commit is submitted as a pull request to master, reviewed, and merged before this issue is marked done.
  • All nox stages pass.
  • Coverage >= 97%.

Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: ca-new-issue-creator

## Metadata - **Branch**: `test/m9-a2a-layer-unit-tests` - **Commit Message**: `test(a2a): add Behave unit tests for entire A2A layer` - **Milestone**: *(none — backlog)* - **Parent Epic**: #399 > **Backlog note:** This issue was discovered during autonomous operation > on milestone v3.8.0. It does not block milestone completion and has been > placed in the backlog for human review and future milestone assignment. --- ## Bug Report ### What Was Tested The test coverage of the A2A layer (`src/cleveragents/a2a/`) during UAT testing. ### Expected Behavior (from spec) Per `docs/specification.md` §Compliance (ADR-048): > **A2A conformance tests**: The server passes the A2A standard test suite for all standard methods. > **Extension method tests**: All `_cleveragents/` methods are tested against documented parameter and response schemas. Per the project's coverage requirement (`pyproject.toml` / `nox -e coverage_report`): > Test coverage >= 97% The A2A layer is the **sole communication protocol** for all client-server interaction. It should have comprehensive unit tests (Behave/Gherkin scenarios in `features/`) covering: - `A2aRequest`, `A2aResponse`, `A2aEvent` model validation - `A2aLocalFacade` dispatch routing and error handling - `SseEventFormatter` SSE wire format compliance - `A2aEventQueue` publish/subscribe/close lifecycle - `A2aVersionNegotiator` version negotiation - `ServerConnectionConfig` URL validation - `map_domain_error()` error code mapping - ASGI app health probe responses ### Actual Behavior (from test) Running `nox -e unit_tests` collects **zero Behave scenarios** for the A2A layer. There are no `.feature` files under `features/` for any module in `src/cleveragents/a2a/`. The following files have **no corresponding Behave feature files**: - `src/cleveragents/a2a/asgi.py` — ASGI health probe app - `src/cleveragents/a2a/models.py` — A2A request/response/event models - `src/cleveragents/a2a/facade.py` — A2A local facade (30+ operation handlers) - `src/cleveragents/a2a/events.py` — SSE formatter and event queue - `src/cleveragents/a2a/errors.py` — Error hierarchy and domain error mapping - `src/cleveragents/a2a/transport.py` — HTTP transport stub - `src/cleveragents/a2a/versioning.py` — Version negotiation - `src/cleveragents/a2a/server_config.py` — Server connection config - `src/cleveragents/a2a/cli_bootstrap.py` — CLI facade bootstrap ### Code Location - `src/cleveragents/a2a/` — entire A2A layer (9 modules, ~1500 lines of code) - No corresponding Behave feature files exist anywhere in the repository for this layer ### Steps to Reproduce 1. Run `nox -e unit_tests` 2. Observe: zero Behave scenarios collected for the A2A layer 3. Run `nox -e coverage_report` 4. Observe: A2A layer coverage is 0% — far below the required 97% ### Impact The A2A layer is the critical protocol boundary between the Presentation and Application layers. Without unit tests: - Regressions in JSON-RPC 2.0 wire format compliance will go undetected - SSE event formatting bugs will not be caught before deployment - A2A facade routing errors will not be caught - The 97% coverage requirement cannot be met for this layer ### Suggested Fix Create Behave feature files under `features/unit/a2a/` covering: - `a2a_models.feature` — A2aRequest, A2aResponse, A2aEvent validation scenarios - `a2a_facade.feature` — A2aLocalFacade dispatch routing scenarios - `a2a_events.feature` — SseEventFormatter, A2aEventQueue scenarios - `a2a_asgi.feature` — ASGI app health probe response scenarios - `a2a_errors.feature` — Error hierarchy and domain error mapping scenarios - `a2a_versioning.feature` — Version negotiation scenarios - `a2a_server_config.feature` — ServerConnectionConfig validation scenarios Step definitions go in `features/steps/a2a/` and any test doubles in `features/mocks/a2a/`. --- ## Subtasks - [ ] Create `features/unit/a2a/a2a_models.feature` — Behave scenarios for `A2aRequest`, `A2aResponse`, `A2aEvent` model validation - [ ] Create `features/unit/a2a/a2a_facade.feature` — Behave scenarios for `A2aLocalFacade` dispatch routing and error handling - [ ] Create `features/unit/a2a/a2a_events.feature` — Behave scenarios for `SseEventFormatter` wire format and `A2aEventQueue` lifecycle - [ ] Create `features/unit/a2a/a2a_asgi.feature` — Behave scenarios for ASGI health probe responses (`/health`, `/live`, `/ready`, `/`) - [ ] Create `features/unit/a2a/a2a_errors.feature` — Behave scenarios for error hierarchy and `map_domain_error()` code mapping - [ ] Create `features/unit/a2a/a2a_versioning.feature` — Behave scenarios for `A2aVersionNegotiator` version negotiation - [ ] Create `features/unit/a2a/a2a_server_config.feature` — Behave scenarios for `ServerConnectionConfig` URL validation - [ ] Create corresponding step definitions in `features/steps/a2a/` - [ ] Place all test doubles/mocks in `features/mocks/a2a/` (no mocks outside this directory) - [ ] Run `nox -e unit_tests` — all scenarios pass - [ ] Run `nox -e coverage_report` — A2A layer coverage >= 97% - [ ] Run `nox` (all default sessions) — all stages pass ## Definition of Done This issue is complete when: - [ ] All subtasks above are completed and checked off. - [ ] All Behave scenarios for the A2A layer pass under `nox -e unit_tests`. - [ ] A Git commit is created where the **first line** of the commit message matches the Commit Message in Metadata exactly (`test(a2a): add Behave unit tests for entire A2A layer`), followed by a blank line, then additional lines providing relevant details about the implementation, and ending with `ISSUES CLOSED: #<this issue number>`. - [ ] The commit is pushed to the remote on the branch matching the **Branch** in Metadata exactly (`test/m9-a2a-layer-unit-tests`). - [ ] The commit is submitted as a **pull request** to `master`, reviewed, and **merged** before this issue is marked done. - [ ] All nox stages pass. - [ ] Coverage >= 97%. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-new-issue-creator
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Blocks
#399 Epic: Post-MVP Server & Clients
cleveragents/cleveragents-core
Reference
cleveragents/cleveragents-core#3971
No description provided.