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
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"
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