fix(cli): fix project context set JSON/YAML output structure #6626

Merged
HAL9000 merged 6 commits from fix/issue-6319-project-context-set-output into master 2026-06-03 23:35:09 +00:00

6 Commits

Author SHA1 Message Date
controller-ci-rerun e0b77082b7 chore: re-trigger CI [controller]
CI / lint (pull_request) Successful in 39s
CI / helm (pull_request) Successful in 32s
CI / build (pull_request) Successful in 37s
CI / push-validation (pull_request) Successful in 51s
CI / quality (pull_request) Successful in 1m1s
CI / security (pull_request) Successful in 1m11s
CI / typecheck (pull_request) Successful in 1m17s
CI / unit_tests (pull_request) Successful in 4m57s
CI / docker (pull_request) Successful in 1m44s
CI / integration_tests (pull_request) Successful in 8m18s
CI / coverage (pull_request) Successful in 8m50s
CI / status-check (pull_request) Successful in 3s
2026-06-03 19:10:06 -04:00
HAL9000 c7caa20edd fix(cli): wire context_set to spec-aligned rendering helpers
CI / lint (pull_request) Successful in 46s
CI / typecheck (pull_request) Successful in 1m15s
CI / helm (pull_request) Successful in 30s
CI / build (pull_request) Successful in 34s
CI / push-validation (pull_request) Successful in 32s
CI / quality (pull_request) Successful in 1m53s
CI / security (pull_request) Successful in 1m58s
CI / integration_tests (pull_request) Successful in 9m42s
CI / unit_tests (pull_request) Failing after 16m48s
CI / coverage (pull_request) Has been cancelled
CI / docker (pull_request) Has been cancelled
CI / status-check (pull_request) Has been cancelled
The PR added build_context_set_payload / render_context_set_plain /
render_context_set_rich in cleveragents.cli.rendering.project_context_set
but context_set never called them: rich output rendered a single
"Context Policy Updated" panel and json/yaml/plain went through
format_output(data, output_format) with no envelope kwargs. The five
BDD scenarios validating the spec envelope therefore failed.

Replace the tail of context_set so rich emits the four spec panels
(Context Policy / Limits / Summarization / Other Views) plus the
"checkmark Context policy updated" line, plain calls
render_context_set_plain directly, and json/yaml flow through
format_output with command="project context set", status="ok",
exit_code=0, and messages=[{level: ok, text: "Context policy updated"}].

ISSUES CLOSED: #6319
2026-06-03 17:30:22 -04:00
HAL9000 b502bb8542 test(coverage): add plain-format and bytes-size scenarios for project_context_set rendering
render_context_set_plain (~49 lines) was completely uncovered because no
existing test exercised the plain output path for context_set. Add a
coverage-boost scenario that uses format "plain" to cover those lines.

Also add a scenario with max_file_size=100 (not divisible by any binary
unit) to cover the _format_size bytes-fallback path (line 36 of
project_context_set.py).

ISSUES CLOSED: #6319
2026-06-03 17:30:22 -04:00
HAL9000 30ee7a8dd6 fix(cli): fix lint violations in project_context_set rendering module
- Fix E501 line-length violations (lines 154, 184, 188, 194, 196) by
  extracting ternary expressions into local variables in
  render_context_set_plain and render_context_set_rich
- Fix I001 import block formatting in project_context_set.py
- Fix ruff format issue in project_context_cli_steps.py

ISSUES CLOSED: #6319
2026-06-03 17:30:22 -04:00
HAL9000 0aacec7845 fix(cli): address PR #6626 review blockers for context set output
- Fix ruff import ordering in project_context_cli_steps.py (yaml moved to third-party section)
- Remove unused noqa: F401 suppression in rendering/__init__.py
- Add *args, **kwargs to _test_format_output stub in coverage boost steps (fixes TypeError)
- Extract context-set step definitions into dedicated module (project_context_set_steps.py)
  to bring project_context_cli_steps.py under 500-line limit (469 -> 316 lines)
- Revert spec changes for context show/inspect/simulate message format (bare strings)
  to keep PR focused on issue #6319 (context set only),
2026-06-03 17:30:22 -04:00
HAL9000 388fc458c5 fix(cli): fix project context set JSON/YAML output structure (#6319)
Implemented spec-compliant JSON, YAML, plain, and rich outputs for `agents project context set`. Added BDD coverage verifying the new output structure across formats.\n\nISSUES CLOSED: #6319
2026-06-03 17:30:22 -04:00