refactor: route CLI→Application communication through A2A boundary #10787

Merged
HAL9000 merged 4 commits from refactor/auto-guard-1-cli-a2a-boundary into master 2026-06-07 00:03:29 +00:00

4 Commits

Author SHA1 Message Date
HAL9000 03d2df26ce fix(tests): align CI tests with A2A boundary refactor
CI / lint (pull_request) Successful in 56s
CI / quality (pull_request) Successful in 56s
CI / build (pull_request) Successful in 54s
CI / typecheck (pull_request) Successful in 1m21s
CI / security (pull_request) Successful in 1m21s
CI / push-validation (pull_request) Successful in 30s
CI / helm (pull_request) Successful in 49s
CI / integration_tests (pull_request) Successful in 10m11s
CI / unit_tests (pull_request) Successful in 11m31s
CI / docker (pull_request) Successful in 2m54s
CI / coverage (pull_request) Successful in 12m17s
CI / status-check (pull_request) Successful in 3s
The shared `format_data` serializer introduced for the CLI→Application
A2A boundary returns raw payloads without the `{"data": ...}` envelope
that the legacy CLI `format_output` wraps around. Two test-step
definitions (`step_artifacts_json_validation`,
`step_artifacts_json_apply_summary`) still unwrapped that envelope and
crashed with `KeyError: 'data'`, errrring the Behave scenarios
`Plan artifacts shows validation results when available` and
`Artifacts include apply summary from metadata`.

Also remove the stale `@tdd_expected_fail` tag from the Robot scenario
`WF02 Mocked Generation Produces Test Artifacts Only`: the scenario
exercises the `_cleveragents/plan/artifacts` A2A dispatch path that this
PR added and now passes naturally; the `tdd_expected_fail_listener`
inverts the passing result to a failure with "Bug appears to be fixed.
Remove the tdd_expected_fail tag".

Adds a CHANGELOG entry covering both the boundary refactor and these
test alignments.

Refs: #9962
Refs: #4253
2026-06-06 19:15:12 -04:00
HAL9000 913c37416e test(a2a): expand output_format coverage scenarios for datetime, enum, list, and table paths 2026-06-06 19:05:19 -04:00
HAL9000 a11cd70547 style: apply ruff formatting to a2a_boundary_enforcement_steps.py
Apply ruff format to fix CI lint gate failure. The format check
(nox -s format -- --check) was failing because implicit string
concatenation and multi-line assert/raise expressions did not
match ruff's canonical formatting.

ISSUES CLOSED: #9962
EOF && git -C /tmp/implementation-worker-1776891830/repo push --force-with-lease origin "refactor/auto-guard-1-cli-a2a-boundary"
2026-06-06 19:05:19 -04:00
HAL9000 f9c308c541 refactor: route CLI→Application communication through A2A boundary
Created src/cleveragents/shared/output_format.py - a new shared module
with format_data() function that provides JSON/YAML/plain/table
serialization without any CLI dependencies.

Fixed reverse dependency in plan_apply_service.py - changed import from
cleveragents.cli.formatting to cleveragents.shared.output_format (the
most critical architectural violation: Application layer importing from
Presentation layer).

Added .importlinter configuration file with rules to enforce:
- No Application->Presentation (CLI) reverse dependencies
- CLI->Application boundary violations (with current exceptions documented)

Added import-linter>=2.0 to dev dependencies in pyproject.toml.

Added BDD feature file features/a2a_boundary_enforcement.feature with
10 scenarios testing the boundary enforcement and step definitions.

ISSUES CLOSED: #9962
2026-06-06 19:05:19 -04:00