fix(cli): wrap plan apply --format json output in spec-required JSON envelope #9817

Open
HAL9000 wants to merge 2 commits from fix/plan-apply-json-envelope into master

2 Commits

Author SHA1 Message Date
HAL9000 051fbbc269 Add plan_id assertions to Robot and Behave test suites
CI / lint (pull_request) Failing after 35s
CI / quality (pull_request) Successful in 52s
CI / typecheck (pull_request) Successful in 1m20s
CI / helm (pull_request) Successful in 32s
CI / security (pull_request) Successful in 1m32s
CI / build (pull_request) Successful in 35s
CI / push-validation (pull_request) Successful in 41s
CI / unit_tests (pull_request) Failing after 5m16s
CI / coverage (pull_request) Has been skipped
CI / docker (pull_request) Has been skipped
CI / integration_tests (pull_request) Failing after 8m23s
CI / status-check (pull_request) Failing after 3s
Reviewer #8388 flagged that plan_id was missing from the required_data
set in check_data_fields() and from the Behave data sub-fields scenario.

Robot helper (robot/helper_plan_apply_json_envelope.py):
  - Added 'plan_id' as first entry in required_data set

Behave feature (features/plan_apply_json_envelope.feature):
  - Added step asserting 'plan_id' exists in apply JSON data output

Closes #9449
2026-06-03 14:15:38 -04:00
HAL9000 86b8615d9e bug(cli): plan apply --format json returns raw plan dict instead of spec-required JSON envelope
Fix the agents plan apply --format json command to return a spec-compliant
JSON envelope instead of a raw plan dictionary. The new envelope includes
command, status, exit_code, timing, and data fields containing artifacts,
changes, validation, sandbox cleanup, and lifecycle information.

Added comprehensive BDD tests (behave) and Robot Framework integration
tests to verify the JSON envelope structure across all output formats.

ISSUES CLOSED: #9449
2026-06-03 14:15:38 -04:00