UAT: agents actor CLI JSON output uses is_default/is_built_in field names — spec requires default/built_in #3606

Open
opened 2026-04-05 20:20:45 +00:00 by freemo · 0 comments
Owner

Background and Context

The specification defines the JSON output format for actor commands. The agents actor list and agents actor show commands should output actor data with specific field names matching the A2A protocol response structure. A UAT test discovered that the CLI's _actor_spec_dict() helper emits field names that deviate from the spec.

Current Behavior

In src/cleveragents/cli/commands/actor.py, the _actor_spec_dict() function (line ~382) produces:

{
    "name": actor.name,
    "provider": actor.provider,
    "model": actor.model,
    "unsafe": actor.unsafe,
    "is_default": actor.is_default,      # ← uses is_default
    "is_built_in": actor.is_built_in,    # ← uses is_built_in
    "config_hash": actor.config_hash,
    "schema_version": actor.schema_version,
    "updated_at": actor.updated_at.isoformat(),
}

Expected Behavior

The specification's agents actor list JSON output example shows:

{
  "name": "local/reviewer",
  "provider": "openai",
  "model": "gpt-4",
  "default": true,
  "unsafe": false,
  "type": "graph"
}

The spec uses "default" (not "is_default") and "type" (not "is_built_in"). The is_built_in field is not present in the spec output at all — it is replaced by "type" derived from the actor's config_blob. Additionally, the spec's agents actor add JSON output wraps the actor dict under an "actor_added" key, but the code outputs a flat dict without this wrapper.

Acceptance Criteria

  • _actor_spec_dict() uses "default" instead of "is_default" in the output dict
  • _actor_spec_dict() includes "type" field derived from the actor's config_blob instead of "is_built_in"
  • agents actor list --format json output matches spec field names exactly
  • agents actor show --format json output matches spec field names exactly
  • agents actor add --format json output wraps actor data under "actor_added" key per spec
  • Existing Behave scenarios updated to assert new field names
  • All nox stages pass

Metadata

  • Branch: fix/actor-cli-json-field-names
  • Commit Message: fix(cli): use spec-compliant field names in actor JSON output
  • Milestone: (backlog — see note below)
  • Parent Epic: #392

Backlog note: This issue was discovered during autonomous operation
on milestone v3.2.0. It does not block milestone completion and has been
placed in the backlog for human review and future milestone assignment.

Subtasks

  • Rename "is_default""default" in _actor_spec_dict() output dict
  • Replace "is_built_in" with "type" (derived from actor.config_blob) in _actor_spec_dict() output dict
  • Audit all callers of _actor_spec_dict() (list, show, add commands) and align wrappers to spec (e.g., "actor_added" key for add)
  • Tests (Behave): Update existing actor CLI scenarios to assert "default" and "type" field names
  • Tests (Behave): Add scenario covering agents actor add --format json wrapper key "actor_added"
  • Verify coverage ≥ 97% via nox -s coverage_report
  • Run nox (all default sessions), fix any errors

Definition of Done

This issue is complete when:

  • 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, followed by a blank line, then additional lines providing relevant details about the implementation.
  • The commit is pushed to the remote on the branch matching the Branch in Metadata exactly.
  • The commit is submitted as a pull request to master, reviewed, and merged before this issue is marked done.
  • All nox stages pass.
  • Coverage ≥ 97%.

Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: ca-new-issue-creator

## Background and Context The specification defines the JSON output format for actor commands. The `agents actor list` and `agents actor show` commands should output actor data with specific field names matching the A2A protocol response structure. A UAT test discovered that the CLI's `_actor_spec_dict()` helper emits field names that deviate from the spec. ## Current Behavior In `src/cleveragents/cli/commands/actor.py`, the `_actor_spec_dict()` function (line ~382) produces: ```python { "name": actor.name, "provider": actor.provider, "model": actor.model, "unsafe": actor.unsafe, "is_default": actor.is_default, # ← uses is_default "is_built_in": actor.is_built_in, # ← uses is_built_in "config_hash": actor.config_hash, "schema_version": actor.schema_version, "updated_at": actor.updated_at.isoformat(), } ``` ## Expected Behavior The specification's `agents actor list` JSON output example shows: ```json { "name": "local/reviewer", "provider": "openai", "model": "gpt-4", "default": true, "unsafe": false, "type": "graph" } ``` The spec uses `"default"` (not `"is_default"`) and `"type"` (not `"is_built_in"`). The `is_built_in` field is not present in the spec output at all — it is replaced by `"type"` derived from the actor's `config_blob`. Additionally, the spec's `agents actor add` JSON output wraps the actor dict under an `"actor_added"` key, but the code outputs a flat dict without this wrapper. ## Acceptance Criteria - [ ] `_actor_spec_dict()` uses `"default"` instead of `"is_default"` in the output dict - [ ] `_actor_spec_dict()` includes `"type"` field derived from the actor's `config_blob` instead of `"is_built_in"` - [ ] `agents actor list --format json` output matches spec field names exactly - [ ] `agents actor show --format json` output matches spec field names exactly - [ ] `agents actor add --format json` output wraps actor data under `"actor_added"` key per spec - [ ] Existing Behave scenarios updated to assert new field names - [ ] All nox stages pass --- ## Metadata - **Branch**: `fix/actor-cli-json-field-names` - **Commit Message**: `fix(cli): use spec-compliant field names in actor JSON output` - **Milestone**: *(backlog — see note below)* - **Parent Epic**: #392 > **Backlog note:** This issue was discovered during autonomous operation > on milestone v3.2.0. It does not block milestone completion and has been > placed in the backlog for human review and future milestone assignment. ## Subtasks - [ ] Rename `"is_default"` → `"default"` in `_actor_spec_dict()` output dict - [ ] Replace `"is_built_in"` with `"type"` (derived from `actor.config_blob`) in `_actor_spec_dict()` output dict - [ ] Audit all callers of `_actor_spec_dict()` (list, show, add commands) and align wrappers to spec (e.g., `"actor_added"` key for add) - [ ] Tests (Behave): Update existing actor CLI scenarios to assert `"default"` and `"type"` field names - [ ] Tests (Behave): Add scenario covering `agents actor add --format json` wrapper key `"actor_added"` - [ ] Verify coverage ≥ 97% via `nox -s coverage_report` - [ ] Run `nox` (all default sessions), fix any errors ## Definition of Done This issue is complete when: - 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, followed by a blank line, then additional lines providing relevant details about the implementation. - The commit is pushed to the remote on the branch matching the **Branch** in Metadata exactly. - The commit is submitted as a **pull request** to `master`, reviewed, and **merged** before this issue is marked done. - All nox stages pass. - Coverage ≥ 97%. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-new-issue-creator
freemo added this to the v3.7.0 milestone 2026-04-05 20:23:27 +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.

Blocks
#392 Epic: Actor YAML & Compiler
cleveragents/cleveragents-core
Reference
cleveragents/cleveragents-core#3606
No description provided.