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

Merged
HAL9000 merged 5 commits from pr-9817-plan-apply-json into master 2026-06-15 01:23:46 +00:00

5 Commits

Author SHA1 Message Date
HAL9000 372ef09153 fix(cli): add _apply_output_dict and fix robot/behave tests for plan apply JSON envelope
CI / push-validation (pull_request) Successful in 24s
CI / helm (pull_request) Successful in 51s
CI / build (pull_request) Successful in 51s
CI / lint (pull_request) Successful in 1m8s
CI / typecheck (pull_request) Successful in 1m9s
CI / quality (pull_request) Successful in 1m9s
CI / security (pull_request) Successful in 1m26s
CI / unit_tests (pull_request) Successful in 6m21s
CI / integration_tests (pull_request) Successful in 8m34s
CI / docker (pull_request) Successful in 1m38s
CI / coverage (pull_request) Successful in 9m16s
CI / status-check (pull_request) Successful in 5s
- Add _apply_output_dict() building the spec-required JSON envelope
- Update lifecycle_apply_plan to use _apply_output_dict for --format json
- Rewrite robot file to use Run Process + helper dispatch pattern
- Rewrite robot helper to use real LifecyclePlan domain objects
- Apply ruff format to plan_apply_json_envelope_steps.py
2026-06-14 21:07:19 -04:00
controller-ci-rerun 27f2fa7dc8 chore: re-trigger CI [controller] 2026-06-14 21:07:19 -04:00
controller-ci-rerun 32bfe5b84a chore: re-trigger CI [controller] 2026-06-14 21:07:19 -04:00
controller-ci-rerun d24a1ab4fe chore: re-trigger CI [controller] 2026-06-14 21:07:19 -04:00
HAL9000 b4a7f26d7c bug(cli): plan apply --format json returns raw plan dict instead of spec-required JSON envelope
The `agents plan apply --format json` command was returning a raw
plan dictionary instead of the spec-required JSON envelope. This fix
introduces a dedicated `_apply_output_dict()` helper that wraps the
non-rich format output in the proper envelope structure with
`command`, `status`, `exit_code`, `data`, `timing`, and `messages`
fields.

The `data` field contains structured information about artifacts,
changes, project, applied_at, validation (test/lint/type_check),
sandbox_cleanup, and lifecycle metrics. Other commands (plan status,
plan cancel, plan use) remain unaffected — they continue using
`_plan_spec_dict`.

Tests: 16 Behave scenarios + 15 Robot Framework integration tests
added covering envelope structure, field presence, sandbox cleanup
state derivation from actual plan state, legacy fallback, cost
metadata, and command isolation.

ISSUES CLOSED: #9449
2026-06-14 21:07:19 -04:00