UAT: agents resource type add/remove/list/show JSON/YAML output missing spec-required output envelope and structured data fields #4834

Open
opened 2026-04-08 20:03:04 +00:00 by HAL9000 · 0 comments
Owner

Bug Report

Feature Area: Resource Registry — agents resource type command JSON/YAML output format

Severity: Medium — machine-readable output is structurally wrong; automation scripts relying on JSON output will fail


What Was Tested

_resource_type_dict() helper and all four agents resource type commands in src/cleveragents/cli/commands/resource.py.

Expected Behavior (from spec)

All agents resource type commands should produce JSON/YAML output wrapped in the standard output envelope with structured data fields.

agents resource type add (spec lines 9961–9984):

{
  "command": "resource type add",
  "status": "ok",
  "exit_code": 0,
  "data": {
    "name": "local/svn",
    "physical_virtual": "physical",
    "user_addable": true,
    "registered": "2026-02-09T10:15:00Z",
    "cli_arguments": [...],
    "child_types": {
      "auto_discover": ["svn-revision", "svn-file"],
      "manual_link": ["fs-mount"]
    },
    "sandbox": { "strategy": "copy_on_write", "handler": "SVNHandler (custom)" }
  },
  "timing": { "started": "...", "duration_ms": 85 },
  "messages": ["Resource type registered", "New subcommand available: agents resource add local/svn"]
}

agents resource type remove (spec lines 10071–10081):

{
  "command": "resource type remove",
  "status": "ok",
  "exit_code": 0,
  "data": { "name": "local/svn", "resources_using": 0, "subcommand_removed": true },
  "timing": {...},
  "messages": ["Resource type removed"]
}

agents resource type list (spec lines 10207–10246):

{
  "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": [...] },
      ...
    ],
    "summary": { "built_in": 24, "custom": 1, "user_addable": 4 }
  },
  "timing": {...},
  "messages": ["25 resource types listed"]
}

agents resource type show (spec lines 10485–10514):

{
  "command": "resource type show",
  "status": "ok",
  "exit_code": 0,
  "data": {
    "name": "git-checkout",
    "source": "built-in",
    "physical_virtual": "physical",
    "cli_arguments": [{ "argument": "--path", "required": true, "type": "path", ... }],
    "child_types": [{ "type": "git", "auto": true, "manual_link": false, ... }],
    "sandbox": { "strategy": "git_worktree", "checkpointable": true, "handler": "GitCheckoutHandler" }
  },
  "timing": {...},
  "messages": ["Resource type details loaded"]
}

Actual Behavior (from code)

_resource_type_dict() returns a flat dict with wrong field names:

{
    "name": spec.name,
    "description": spec.description or "",
    "resource_kind": str(spec.resource_kind),   # should be "physical_virtual"
    "sandbox_strategy": str(spec.sandbox_strategy),  # should be nested under "sandbox"
    "user_addable": spec.user_addable,
    "built_in": spec.built_in,
    "inherits": ...,
    "cli_args": [...],   # should be "cli_arguments" with "argument" key
    "parent_types": spec.parent_types,
    "child_types": spec.child_types,  # should be structured with auto/manual_link flags
    "handler": spec.handler,
    "capabilities": spec.capabilities,
    "equivalence": ...,
}

No command, status, exit_code, timing, or messages envelope. Field names differ from spec (resource_kind vs physical_virtual, cli_args vs cli_arguments, flat child_types vs structured with auto/manual_link).

Code Location

  • src/cleveragents/cli/commands/resource.py_resource_type_dict(), type_add(), type_remove(), type_list(), type_show()

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

## Bug Report **Feature Area:** Resource Registry — `agents resource type` command JSON/YAML output format **Severity:** Medium — machine-readable output is structurally wrong; automation scripts relying on JSON output will fail --- ## What Was Tested `_resource_type_dict()` helper and all four `agents resource type` commands in `src/cleveragents/cli/commands/resource.py`. ## Expected Behavior (from spec) All `agents resource type` commands should produce JSON/YAML output wrapped in the standard output envelope with structured data fields. ### `agents resource type add` (spec lines 9961–9984): ```json { "command": "resource type add", "status": "ok", "exit_code": 0, "data": { "name": "local/svn", "physical_virtual": "physical", "user_addable": true, "registered": "2026-02-09T10:15:00Z", "cli_arguments": [...], "child_types": { "auto_discover": ["svn-revision", "svn-file"], "manual_link": ["fs-mount"] }, "sandbox": { "strategy": "copy_on_write", "handler": "SVNHandler (custom)" } }, "timing": { "started": "...", "duration_ms": 85 }, "messages": ["Resource type registered", "New subcommand available: agents resource add local/svn"] } ``` ### `agents resource type remove` (spec lines 10071–10081): ```json { "command": "resource type remove", "status": "ok", "exit_code": 0, "data": { "name": "local/svn", "resources_using": 0, "subcommand_removed": true }, "timing": {...}, "messages": ["Resource type removed"] } ``` ### `agents resource type list` (spec lines 10207–10246): ```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": [...] }, ... ], "summary": { "built_in": 24, "custom": 1, "user_addable": 4 } }, "timing": {...}, "messages": ["25 resource types listed"] } ``` ### `agents resource type show` (spec lines 10485–10514): ```json { "command": "resource type show", "status": "ok", "exit_code": 0, "data": { "name": "git-checkout", "source": "built-in", "physical_virtual": "physical", "cli_arguments": [{ "argument": "--path", "required": true, "type": "path", ... }], "child_types": [{ "type": "git", "auto": true, "manual_link": false, ... }], "sandbox": { "strategy": "git_worktree", "checkpointable": true, "handler": "GitCheckoutHandler" } }, "timing": {...}, "messages": ["Resource type details loaded"] } ``` ## Actual Behavior (from code) `_resource_type_dict()` returns a flat dict with wrong field names: ```python { "name": spec.name, "description": spec.description or "", "resource_kind": str(spec.resource_kind), # should be "physical_virtual" "sandbox_strategy": str(spec.sandbox_strategy), # should be nested under "sandbox" "user_addable": spec.user_addable, "built_in": spec.built_in, "inherits": ..., "cli_args": [...], # should be "cli_arguments" with "argument" key "parent_types": spec.parent_types, "child_types": spec.child_types, # should be structured with auto/manual_link flags "handler": spec.handler, "capabilities": spec.capabilities, "equivalence": ..., } ``` No `command`, `status`, `exit_code`, `timing`, or `messages` envelope. Field names differ from spec (`resource_kind` vs `physical_virtual`, `cli_args` vs `cli_arguments`, flat `child_types` vs structured with `auto`/`manual_link`). ## Code Location - `src/cleveragents/cli/commands/resource.py` — `_resource_type_dict()`, `type_add()`, `type_remove()`, `type_list()`, `type_show()` --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
HAL9000 added this to the v3.5.0 milestone 2026-04-08 20:17:55 +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#4834
No description provided.