feat(a2a): implement JSON-RPC 2.0 wire format and method routing #10910

Open
HAL9000 wants to merge 8 commits from feature/m9-a2a-jsonrpc into master

8 Commits

Author SHA1 Message Date
cleveragents-auto fd10cb2a01 chore: worker ruff auto-fix (pre-push lint gate)
CI / load-versions (pull_request) Successful in 14s
CI / push-validation (pull_request) Successful in 25s
CI / build (pull_request) Successful in 46s
CI / lint (pull_request) Successful in 57s
CI / quality (pull_request) Successful in 1m3s
CI / typecheck (pull_request) Successful in 1m20s
CI / security (pull_request) Successful in 1m24s
CI / helm (pull_request) Successful in 47s
CI / unit_tests (pull_request) Failing after 6m16s
CI / coverage (pull_request) Has been skipped
CI / docker (pull_request) Has been skipped
CI / integration_tests (pull_request) Failing after 22m59s
CI / status-check (pull_request) Has been cancelled
2026-06-17 19:24:50 -04:00
HAL9000 7661a792a9 fix(a2a): update structure-audit steps for facade/ package layout
The a2a_module_imports_audit and a2a_acp_naming_regression features
inspect src/cleveragents/a2a/ for a flat list of .py files. After this
PR split facade.py into a facade/ package, the literal "facade.py"
file-name assertion failed.

Treat a package directory with __init__.py as equivalent to the
legacy single-file name (facade/ → facade.py) so the structure-audit
steps remain accurate across file→package refactors.

ISSUES CLOSED: #690
2026-06-17 19:24:15 -04:00
HAL9000 28183fe8e3 fix(a2a): restore AgentCardGenerator class for handlers and tests
The standard A2A method handler `getExtendedAgentCard` and the BDD/Robot
test suites reference `AgentCardGenerator` (a class with `server_url`,
`streaming`, `push_notifications` constructor args and `generate()` /
`generate_well_known()` methods), but the agent_card module exposed
only the `build_agent_card` function. This broke three required CI
gates:

- typecheck: pyright flagged `AgentCardGenerator` as unknown import
  symbol in `facade/_handlers_standard.py`
- unit_tests: top-level `from cleveragents.a2a.agent_card import
  AgentCardGenerator` in `features/steps/a2a_agent_card_steps.py`
  raised ImportError, cascading to all 8 errored test files
- integration_tests: the Robot helper `helper_a2a_agent_card.py`
  failed at import, taking out the A2A Agent Card and Standard A2A
  Methods suites

Restore the class as a thin facade-independent generator that builds
the card from the static `_SKILL_DEFINITIONS` list. Validate
`server_url` (must start with `http://`/`https://`, non-empty).
Add the required `tags` field to `AgentCardSkill` per the Robot
helper's per-skill field check.

Verified locally: typecheck PASS, unit_tests on
`features/a2a_agent_card.feature` PASS (17/17 scenarios), all 6 Robot
helper subcommands print their success sentinels.

ISSUES CLOSED: #690
2026-06-17 19:11:29 -04:00
controller-ci-rerun dfa4d22fc4 chore: re-trigger CI [controller]
CI / load-versions (pull_request) Successful in 15s
CI / push-validation (pull_request) Successful in 22s
CI / build (pull_request) Successful in 45s
CI / lint (pull_request) Successful in 50s
CI / quality (pull_request) Successful in 48s
CI / typecheck (pull_request) Failing after 54s
CI / unit_tests (pull_request) Failing after 1m4s
CI / security (pull_request) Successful in 1m12s
CI / coverage (pull_request) Has been skipped
CI / docker (pull_request) Has been skipped
CI / helm (pull_request) Successful in 39s
CI / integration_tests (pull_request) Failing after 9m55s
CI / status-check (pull_request) Failing after 3s
2026-06-17 18:33:33 -04:00
HAL9000 e44f4cffe6 fix(a2a): fix lint/format failures and remove incorrect tdd_expected_fail tags
- Run ruff format to fix formatting in a2a_agent_card_steps.py,
  helper_a2a_agent_card.py, and _handlers_extension.py (CI lint job
  runs both ruff check and ruff format --check)
- Remove try/except ImportError with # type: ignore from
  a2a_jsonrpc_wire_format_steps.py (zero-tolerance violation);
  use direct imports instead
- Add @mock_only tag to a2a_jsonrpc_wire_format.feature (no DB needed)
- Remove @tdd_expected_fail/@tdd_issue/@tdd_issue_4229 tags from
  A2aErrorDetail scenarios — the data field already exists in the model
  so the bug is fixed; keeping @tdd_expected_fail caused unexpected-pass
  failures in CI unit_tests
- Fix A2aErrorDetail step definitions to use integer codes via
  A2A_CODE_MAP instead of raw string codes
2026-06-17 18:33:33 -04:00
HAL9000 373a094372 fix(a2a): update operation count from 42 to 53 in tests and docs
The PR added 11 standard A2A operations (message/send, tasks/*, etc.)
to the facade, increasing the total from 42 to 53. Update all references:
- robot/helper_a2a_facade.py: fix list_operations() count check
- features/a2a_cli_facade_integration.feature: update scenario text
- features/steps/a2a_cli_facade_integration_steps.py: update assertion
- docs/showcase/cli-tools/server-and-a2a-integration.md: update docs
- docs/development/testing.md: update docs
2026-06-17 18:32:16 -04:00
HAL9000 04afac66e5 fix(a2a): resolve reviewer blocking issues in JSON-RPC facade PR
- Remove all # type: ignore violations: replace with typing.cast() in
  service accessor helpers (_handlers_extension.py) and remove
  try/except ImportError pattern from BDD step file
- Split facade.py (760 lines) into focused submodules under facade/:
  _operations.py (constants), _handlers_standard.py (standard A2A),
  _handlers_extension.py (extension/legacy), _handlers.py (re-export),
  _facade.py (main class) — all files under 500-line limit
- Fix line-length violations in robot/helper_a2a_agent_card.py
- All previously failing integration tests (A2A Facade Wiring) now pass

ISSUES CLOSED: #690
2026-06-17 18:31:47 -04:00
HAL9000 c65e976f60 feat(a2a): implement JSON-RPC 2.0 wire format and method routing
Implements the A2A JSON-RPC 2.0 wire format and method routing layer
per ADR-047 and the updated specification (§Architecture > A2A Integration
Architecture).

Changes:
- Add AgentCardGenerator for /.well-known/agent.json capability discovery
- Add standard A2A method routing (message/send, message/stream, tasks/get,
  tasks/cancel, tasks/list, tasks/subscribe, getExtendedAgentCard) to
  A2aLocalFacade with stub handlers for local mode
- Export AgentCardGenerator from cleveragents.a2a package
- Add BDD feature tests for Agent Card generation and standard A2A routing
- Add Robot Framework integration tests for Agent Card and method routing

ISSUES CLOSED: #690
2026-06-17 18:29:45 -04:00