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
The artifacts() method routes JSON through format_output() which wraps
the payload in a spec-required envelope {"data": ..., "status": ...}.
The two @tdd_issue_4253 step assertions were checking parsed["key"]
directly, but the actual fields live at parsed["data"]["key"].
Update step_artifacts_json_validation and step_artifacts_json_apply_summary
to extract parsed["data"] before asserting on validation_summary and
apply_summary respectively.
ISSUES CLOSED: #9084
## Summary
This PR fixes issue #10878 where architecture reviews were truncated because the regex pattern for parsing file output would stop at the first ``` encountered in the Markdown report.
## Changes
- Change file delimiters from ``` to >>>>>>>/<<<<<<< to avoid Markdown conflicts
- Add tier hydration before strategize phase in plan_executor.py
- Increase max_tokens to 16384 in llm_actors.py for longer outputs
- Increase context_max_tokens_hot from 16000 to 32000 in settings.py
- Fix get_hot_view → get_hot_fragments in strategy_actor.py and plan_executor.py
- Add opencode to skip directories in context_tier_hydrator.py
- Change sandbox output location to plan-output/ directory in plan.py
- Add get_context_summary stub method to acms_service.py
## Testing
Run architecture review action and verify the output report is complete with all sections.
Reviewed-on: #10938
The format_output() function returned a string that callers passed to
Rich console.print(), which wraps long lines at terminal width. This
injected literal newline characters into JSON string values (e.g. in
definition_of_done fields), producing invalid JSON that downstream
parsers could not decode (JSONDecodeError: Invalid control character).
For machine-readable formats (json, yaml, plain), format_output() now
writes the rendered output directly to sys.stdout and returns an empty
string. This preserves the exact serialization from json.dumps/
yaml.dump without Rich text processing artifacts.
Refs: #746
Add PlanApplyService with diff(), artifacts(), persist_apply_summary(),
handle_merge_failure(), and guard_empty_changeset() methods.
- plan diff: renders changeset in rich/plain/json/yaml formats
- plan artifacts: shows plan metadata, changeset summary, sandbox refs
- persist_apply_summary: stores files_changed/validations_run in plan metadata
- handle_merge_failure: transitions plan to error state with conflict details
- guard_empty_changeset: blocks apply on empty changeset (--allow-empty override)
CLI: plan diff and plan artifacts commands with --format flag.
Tests: 20 Behave scenarios, 8 Robot integration tests, 4 ASV benchmarks.
Docs: docs/reference/plan_apply.md with CLI reference.
Implements D0b.apply from the implementation plan.