agents version JSON output structure flat instead of spec-required nested cli/build/dependencies sub-objects #4107

Open
opened 2026-04-06 10:21:36 +00:00 by hurui200320 · 1 comment
Member

Metadata

  • Branch: fix/version-json-nested-structure
  • Commit Message: fix(system): restructure build_version_data() to return spec-compliant nested sub-objects
  • Milestone: None (backlog)
  • Parent Epic: TBD - requires manual linking

Description

Background

agents version --format json produces a flat JSON payload under data instead of the three nested sub-objects (cli, build, dependencies) required by docs/specification.md (line ~630). The root cause is that build_version_data() in src/cleveragents/cli/commands/system.py returns a flat dictionary.

Current Behavior

{"data": {"version": "1.0.0", "channel": "stable", "python": "3.13.3", "build_date": "2026-04-06", "commit": "658b86c9", "schema": "v3", "platform": "linux-x86_64", "dependencies": {"langgraph": "1.1.6", "langchain-core": "1.2.26", "pydantic": "2.12.5", "typer": "0.23.1"}}}

Expected Behavior

{"data": {"cli": {"name": "CleverAgents CLI", "version": "1.0.0", "channel": "stable", "python": "3.13"}, "build": {"build_date": "2026-02-08", "commit": "a17c3f9", "schema": "v3", "platform": "linux-x86_64"}, "dependencies": {"langgraph": "0.2.60", "langchain": "0.3.18", "mcp_sdk": "1.4.0", "pydantic": "2.10.4"}}}

All keys are flat under data instead of grouped into cli/build sub-objects. Also missing data.cli.name field ("CleverAgents CLI").

Acceptance Criteria

  • agents --format json version returns data with three nested keys: cli, build, dependencies
  • cli contains: name, version, channel, python
  • build contains: build_date, commit, schema, platform
  • dependencies remains as-is

Subtasks

  • Refactor build_version_data() in src/cleveragents/cli/commands/system.py
  • Update rich rendering to handle new structure
  • Tests: add/update tests covering the change
  • Run nox (all default sessions), fix any errors
  • Verify coverage >= 97% via nox -s coverage_report

Definition of Done

  • All subtasks above are completed and checked off
  • A Git commit is created where the first line of the commit message matches the Commit Message in Metadata exactly
  • The commit is pushed to the branch from Metadata
  • PR submitted to master, reviewed, and merged
  • All nox stages pass
  • Coverage >= 97%
## Metadata - **Branch**: `fix/version-json-nested-structure` - **Commit Message**: `fix(system): restructure build_version_data() to return spec-compliant nested sub-objects` - **Milestone**: None (backlog) - **Parent Epic**: TBD - requires manual linking ## Description ### Background `agents version --format json` produces a flat JSON payload under `data` instead of the three nested sub-objects (`cli`, `build`, `dependencies`) required by `docs/specification.md` (line ~630). The root cause is that `build_version_data()` in `src/cleveragents/cli/commands/system.py` returns a flat dictionary. ### Current Behavior ```json {"data": {"version": "1.0.0", "channel": "stable", "python": "3.13.3", "build_date": "2026-04-06", "commit": "658b86c9", "schema": "v3", "platform": "linux-x86_64", "dependencies": {"langgraph": "1.1.6", "langchain-core": "1.2.26", "pydantic": "2.12.5", "typer": "0.23.1"}}} ``` ### Expected Behavior ```json {"data": {"cli": {"name": "CleverAgents CLI", "version": "1.0.0", "channel": "stable", "python": "3.13"}, "build": {"build_date": "2026-02-08", "commit": "a17c3f9", "schema": "v3", "platform": "linux-x86_64"}, "dependencies": {"langgraph": "0.2.60", "langchain": "0.3.18", "mcp_sdk": "1.4.0", "pydantic": "2.10.4"}}} ``` All keys are flat under `data` instead of grouped into `cli`/`build` sub-objects. Also missing `data.cli.name` field ("CleverAgents CLI"). ### Acceptance Criteria - `agents --format json version` returns `data` with three nested keys: `cli`, `build`, `dependencies` - `cli` contains: `name`, `version`, `channel`, `python` - `build` contains: `build_date`, `commit`, `schema`, `platform` - `dependencies` remains as-is ## Subtasks - [ ] Refactor `build_version_data()` in `src/cleveragents/cli/commands/system.py` - [ ] Update rich rendering to handle new structure - [ ] Tests: add/update tests covering the change - [ ] Run `nox` (all default sessions), fix any errors - [ ] Verify coverage >= 97% via `nox -s coverage_report` ## Definition of Done - [ ] All subtasks above are completed and checked off - [ ] A Git commit is created where the first line of the commit message matches the Commit Message in Metadata exactly - [ ] The commit is pushed to the branch from Metadata - [ ] PR submitted to `master`, reviewed, and merged - [ ] All nox stages pass - [ ] Coverage >= 97%
Owner

Thank you for filing this issue, @hurui200320. The flat vs nested JSON structure for agents version is a clear spec compliance issue.

Triage assessment:

  • Clear title and description
  • Current vs expected behavior with JSON examples
  • Metadata (commit message, branch)
  • Subtasks and Definition of Done
  • Priority: Priority/Medium is appropriate — this affects programmatic consumers of the version command
  • Story Points: S (2 points) — restructuring build_version_data() to return nested sub-objects and updating the rich renderer
  • Parent Epic: Needs manual linking

This issue is ready for verification and implementation.


Automated by CleverAgents Bot
Supervisor: Human Liaison | Agent: ca-human-liaison

Thank you for filing this issue, @hurui200320. The flat vs nested JSON structure for `agents version` is a clear spec compliance issue. **Triage assessment:** - ✅ Clear title and description - ✅ Current vs expected behavior with JSON examples - ✅ Metadata (commit message, branch) - ✅ Subtasks and Definition of Done - **Priority**: `Priority/Medium` is appropriate — this affects programmatic consumers of the version command - **Story Points**: S (2 points) — restructuring `build_version_data()` to return nested sub-objects and updating the rich renderer - **Parent Epic**: Needs manual linking This issue is ready for verification and implementation. --- **Automated by CleverAgents Bot** Supervisor: Human Liaison | Agent: ca-human-liaison
HAL9000 added this to the v3.5.0 milestone 2026-04-09 03:11:01 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
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#4107
No description provided.