UAT: agents resource type list --format json returns flat array with wrong field names instead of spec-required {resource_types, summary} nested object #6831

Open
opened 2026-04-10 02:27:03 +00:00 by HAL9000 · 0 comments
Owner

Background and Context

The specification (§agents resource type list, JSON output) defines a specific JSON schema for agents resource type list --format json:

{
  "command": "resource type list",
  "status": "ok",
  "exit_code": 0,
  "data": {
    "resource_types": [
      { "name": "git-checkout", "source": "built-in", "physical_virtual": "physical", "addable": true, "auto_children": ["git", "fs-directory"] },
      ...
    ],
    "summary": {
      "built_in": 24,
      "custom": 1,
      "user_addable": 4
    }
  }
}

This is relevant to the Database Resource Handler feature area because the spec database type discoverability requirement depends on agents resource type list working correctly with the expected output schema.

Current Behavior

Running agents resource type list --format json produces:

{
  "command": "",
  "status": "ok",
  "exit_code": 0,
  "data": [
    {
      "name": "aws-account",
      "description": "...",
      "resource_kind": "physical",
      "sandbox_strategy": "none",
      "user_addable": true,
      "built_in": true,
      "inherits": "cloud-account",
      "cli_args": [...]
    },
    ...
  ]
}

The following spec violations are present:

  1. data is a flat array instead of an object with resource_types and summary keys
  2. resource_kind instead of physical_virtual — spec uses physical_virtual key
  3. user_addable instead of addable — spec uses addable key
  4. Missing source field — spec requires source: "built-in" or source: "custom"
  5. Missing auto_children field — spec requires array of auto-discovered child type names
  6. Missing summary object — spec requires { built_in: N, custom: N, user_addable: N }
  7. command field is empty string — should be "resource type list" (see also #6791)

This is particularly relevant to database type testing because the spec's database type discoverability requirement depends on this output being schema-correct.

Expected Behavior (per spec)

agents resource type list --format json should return:

{
  "data": {
    "resource_types": [
      { "name": "sqlite", "source": "built-in", "physical_virtual": "physical", "addable": true, "auto_children": [] },
      { "name": "postgres", "source": "built-in", "physical_virtual": "physical", "addable": true, "auto_children": [] },
      { "name": "mysql", "source": "built-in", "physical_virtual": "physical", "addable": true, "auto_children": [] },
      { "name": "duckdb", "source": "built-in", "physical_virtual": "physical", "addable": true, "auto_children": [] },
      ...
    ],
    "summary": { "built_in": N, "custom": M, "user_addable": K }
  }
}

Steps to Reproduce

agents resource type list --format json

Observe that data is a flat array with incorrect field names and no summary.

Acceptance Criteria

  • data is an object with resource_types (array) and summary (object)
  • Each type entry uses physical_virtual (not resource_kind)
  • Each type entry uses addable (not user_addable)
  • Each type entry includes source: "built-in" or source: "custom"
  • Each type entry includes auto_children: [...] (array of auto-discovered child type names)
  • summary includes built_in, custom, and user_addable integer counts
  • command field is "resource type list" (not empty string)

Subtasks

  • Fix agents resource type list JSON serialization in src/cleveragents/cli/commands/resource.py or its renderer
  • Use physical_virtual, addable, source, and auto_children field names in output
  • Add summary sub-object with built-in/custom/user-addable counts
  • Add Behave unit tests covering the JSON schema for resource type list
  • Add Robot integration test for resource type list --format json schema
  • Verify coverage >=97%
  • Run nox (all sessions), fix any errors

Definition of Done

This issue is complete when:

  • All subtasks are completed.
  • A commit is created and pushed to the correct branch.
  • A pull request is submitted, reviewed, and merged.

Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: uat-tester

## Background and Context The specification (§agents resource type list, JSON output) defines a specific JSON schema for `agents resource type list --format json`: ```json { "command": "resource type list", "status": "ok", "exit_code": 0, "data": { "resource_types": [ { "name": "git-checkout", "source": "built-in", "physical_virtual": "physical", "addable": true, "auto_children": ["git", "fs-directory"] }, ... ], "summary": { "built_in": 24, "custom": 1, "user_addable": 4 } } } ``` This is relevant to the Database Resource Handler feature area because the spec database type discoverability requirement depends on `agents resource type list` working correctly with the expected output schema. ## Current Behavior Running `agents resource type list --format json` produces: ```json { "command": "", "status": "ok", "exit_code": 0, "data": [ { "name": "aws-account", "description": "...", "resource_kind": "physical", "sandbox_strategy": "none", "user_addable": true, "built_in": true, "inherits": "cloud-account", "cli_args": [...] }, ... ] } ``` The following spec violations are present: 1. **`data` is a flat array** instead of an object with `resource_types` and `summary` keys 2. **`resource_kind` instead of `physical_virtual`** — spec uses `physical_virtual` key 3. **`user_addable` instead of `addable`** — spec uses `addable` key 4. **Missing `source` field** — spec requires `source: "built-in"` or `source: "custom"` 5. **Missing `auto_children` field** — spec requires array of auto-discovered child type names 6. **Missing `summary` object** — spec requires `{ built_in: N, custom: N, user_addable: N }` 7. **`command` field is empty string** — should be `"resource type list"` (see also #6791) This is particularly relevant to database type testing because the spec's database type discoverability requirement depends on this output being schema-correct. ## Expected Behavior (per spec) `agents resource type list --format json` should return: ```json { "data": { "resource_types": [ { "name": "sqlite", "source": "built-in", "physical_virtual": "physical", "addable": true, "auto_children": [] }, { "name": "postgres", "source": "built-in", "physical_virtual": "physical", "addable": true, "auto_children": [] }, { "name": "mysql", "source": "built-in", "physical_virtual": "physical", "addable": true, "auto_children": [] }, { "name": "duckdb", "source": "built-in", "physical_virtual": "physical", "addable": true, "auto_children": [] }, ... ], "summary": { "built_in": N, "custom": M, "user_addable": K } } } ``` ## Steps to Reproduce ```bash agents resource type list --format json ``` Observe that `data` is a flat array with incorrect field names and no `summary`. ## Acceptance Criteria - `data` is an object with `resource_types` (array) and `summary` (object) - Each type entry uses `physical_virtual` (not `resource_kind`) - Each type entry uses `addable` (not `user_addable`) - Each type entry includes `source: "built-in"` or `source: "custom"` - Each type entry includes `auto_children: [...]` (array of auto-discovered child type names) - `summary` includes `built_in`, `custom`, and `user_addable` integer counts - `command` field is `"resource type list"` (not empty string) ## Subtasks - [ ] Fix `agents resource type list` JSON serialization in `src/cleveragents/cli/commands/resource.py` or its renderer - [ ] Use `physical_virtual`, `addable`, `source`, and `auto_children` field names in output - [ ] Add `summary` sub-object with built-in/custom/user-addable counts - [ ] Add Behave unit tests covering the JSON schema for `resource type list` - [ ] Add Robot integration test for `resource type list --format json` schema - [ ] Verify coverage >=97% - [ ] Run `nox` (all sessions), fix any errors ## Definition of Done This issue is complete when: - All subtasks are completed. - A commit is created and pushed to the correct branch. - A pull request is submitted, reviewed, and merged. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
HAL9000 added this to the v3.4.0 milestone 2026-04-10 02:27:20 +00:00
HAL9000 self-assigned this 2026-04-10 06:06:37 +00:00
Sign in to join this conversation.
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#6831
No description provided.