fix(cli): align output envelope with specification structure #1187

Merged
freemo merged 1 commit from feature/m4-output-envelope into master 2026-03-30 18:06:36 +00:00
Owner

Summary

Aligns the structured output envelope (JSON/YAML modes) with the specification: {command, status, exit_code, data, timing, messages}.

Changes

  • src/cleveragents/cli/output/session.py: Added status: str field to StructuredOutput; snapshot() and close() derive status from exit_code
  • src/cleveragents/cli/output/materializers.py: _snapshot_to_dict() now emits spec-compliant envelope keys (data instead of elements, messages instead of metadata)
  • Updated BDD step definitions and Robot test helpers to use new key names

Motivation

The previous envelope used non-standard field names (elements, metadata) and was missing the status field, causing spec non-compliance in machine-readable output formats.

Closes #884

## Summary Aligns the structured output envelope (JSON/YAML modes) with the specification: `{command, status, exit_code, data, timing, messages}`. ## Changes - `src/cleveragents/cli/output/session.py`: Added `status: str` field to `StructuredOutput`; `snapshot()` and `close()` derive status from `exit_code` - `src/cleveragents/cli/output/materializers.py`: `_snapshot_to_dict()` now emits spec-compliant envelope keys (`data` instead of `elements`, `messages` instead of `metadata`) - Updated BDD step definitions and Robot test helpers to use new key names ## Motivation The previous envelope used non-standard field names (`elements`, `metadata`) and was missing the `status` field, causing spec non-compliance in machine-readable output formats. Closes #884
freemo added this to the v3.4.0 milestone 2026-03-29 04:09:41 +00:00
freemo left a comment

Review: Looks Good (self-authored — posted as comment)

Clean spec alignment renaming envelope fields (elements -> data, metadata -> messages) and adding status field. Breaking serialization change should be noted in changelog. SD-13 deviation correctly marked as IMPLEMENTED.

## Review: Looks Good (self-authored — posted as comment) Clean spec alignment renaming envelope fields (`elements` -> `data`, `metadata` -> `messages`) and adding `status` field. Breaking serialization change should be noted in changelog. SD-13 deviation correctly marked as IMPLEMENTED.
freemo scheduled this pull request to auto merge when all checks succeed 2026-03-30 17:13:45 +00:00
freemo force-pushed feature/m4-output-envelope from 8dd17abb16
All checks were successful
CI / benchmark-publish (pull_request) Has been skipped
CI / quality (pull_request) Successful in 56s
CI / lint (pull_request) Successful in 3m20s
CI / build (pull_request) Successful in 15s
CI / integration_tests (pull_request) Successful in 3m50s
CI / helm (pull_request) Successful in 22s
CI / typecheck (pull_request) Successful in 4m11s
CI / security (pull_request) Successful in 4m15s
CI / unit_tests (pull_request) Successful in 7m43s
CI / docker (pull_request) Successful in 1m24s
CI / e2e_tests (pull_request) Successful in 12m25s
CI / coverage (pull_request) Successful in 11m39s
CI / status-check (pull_request) Successful in 2s
CI / benchmark-regression (pull_request) Successful in 54m15s
to 1c1f477208
All checks were successful
CI / benchmark-publish (pull_request) Has been skipped
CI / build (pull_request) Successful in 22s
CI / helm (pull_request) Successful in 34s
CI / lint (pull_request) Successful in 3m19s
CI / quality (pull_request) Successful in 3m41s
CI / typecheck (pull_request) Successful in 3m55s
CI / integration_tests (pull_request) Successful in 3m58s
CI / security (pull_request) Successful in 4m5s
CI / unit_tests (pull_request) Successful in 7m30s
CI / docker (pull_request) Successful in 1m31s
CI / coverage (pull_request) Successful in 8m49s
CI / e2e_tests (pull_request) Successful in 17m42s
CI / status-check (pull_request) Successful in 1s
CI / build (push) Successful in 15s
CI / helm (push) Successful in 23s
CI / lint (push) Successful in 3m18s
CI / typecheck (push) Successful in 3m57s
CI / quality (push) Successful in 3m57s
CI / benchmark-regression (push) Has been skipped
CI / security (push) Successful in 4m24s
CI / integration_tests (push) Successful in 6m58s
CI / unit_tests (push) Successful in 7m27s
CI / docker (push) Successful in 1m18s
CI / coverage (push) Successful in 12m17s
CI / e2e_tests (push) Successful in 19m39s
CI / status-check (push) Successful in 1s
CI / benchmark-publish (push) Successful in 28m4s
CI / benchmark-regression (pull_request) Successful in 54m48s
2026-03-30 17:48:51 +00:00
Compare
freemo merged commit 1c1f477208 into master 2026-03-30 18:06:36 +00:00
freemo deleted branch feature/m4-output-envelope 2026-03-30 18:06:37 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cleveragents/cleveragents-core!1187
No description provided.