UAT: agents project create JSON/YAML output missing spec-required sections — paths, defaults, resources panels absent #6111

Open
opened 2026-04-09 14:49:51 +00:00 by HAL9000 · 1 comment
Owner

Summary

The agents project create command's JSON and YAML output does not match the specification. The implementation returns a flat dictionary with basic fields, but the spec requires a structured response with four distinct sections: project, paths, defaults, and resources.

What Was Tested

Feature area: Project creation and management (project-resource-model)
Command: agents project create --description "Backend API" local/api-service
Code location: src/cleveragents/cli/commands/project.pycreate() function, lines 534–645

Expected Behavior (from spec, lines 2611–2675)

The JSON output should be:

{
  "command": "agents project create --description \"Backend API\" local/api-service",
  "status": "ok",
  "exit_code": 0,
  "data": {
    "project": {
      "name": "local/api-service",
      "description": "Backend API",
      "type": "local",
      "created": "2026-02-08T12:46:00Z"
    },
    "paths": {
      "root": "/repos/api-service",
      "data_dir": "/repos/api-service/.cleveragents"
    },
    "defaults": {
      "sandbox": "git_worktree",
      "validations": 0,
      "context_filters": null,
      "automation_profile": null
    },
    "resources": {
      "total": 0,
      "indexed": 0,
      "sandboxable": 0
    }
  },
  "timing": { "duration_ms": 85 },
  "messages": [{ "level": "ok", "text": "Project created" }]
}

When resources and invariants are provided, the JSON should also include linked_resources and invariants sections (spec lines 2740–2798).

Actual Behavior (from code analysis)

The _project_spec_dict() helper (lines 137–168) returns a flat dict with:

{
    "namespaced_name": ...,
    "namespace": ...,
    "name": ...,
    "description": ...,
    "linked_resources": [...],
    "created_at": ...,
    "updated_at": ...
}

This is passed directly to format_output() for non-rich formats. Missing:

  • paths.root and paths.data_dir
  • defaults.sandbox, defaults.validations, defaults.context_filters, defaults.automation_profile
  • resources.total, resources.indexed, resources.sandboxable
  • type field in the project section
  • invariants section when --invariant flags are used
  • Standard response envelope: command, status, exit_code, timing, messages

Rich Output Deviation

The rich output also deviates from spec. The spec (lines 2554–2579) shows four panels:

  1. Project — Name, Description, Type, Created
  2. Paths — Root, Data Dir
  3. Defaults — Sandbox, Validations, Context Filters, Automation Profile
  4. Resources — Total, Indexed, Sandboxable

The implementation shows a single panel with only Name, Namespace, Description, and Resources count.

Steps to Reproduce

agents --format json project create --description "Backend API" local/api-service

Compare output to spec lines 2611–2644.

Impact

Any tooling or scripts consuming agents project create --format json will receive incorrect data structure. The paths section is particularly important for automation workflows that need to know where the project data directory was created.


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

## Summary The `agents project create` command's JSON and YAML output does not match the specification. The implementation returns a flat dictionary with basic fields, but the spec requires a structured response with four distinct sections: `project`, `paths`, `defaults`, and `resources`. ## What Was Tested **Feature area**: Project creation and management (project-resource-model) **Command**: `agents project create --description "Backend API" local/api-service` **Code location**: `src/cleveragents/cli/commands/project.py` — `create()` function, lines 534–645 ## Expected Behavior (from spec, lines 2611–2675) The JSON output should be: ```json { "command": "agents project create --description \"Backend API\" local/api-service", "status": "ok", "exit_code": 0, "data": { "project": { "name": "local/api-service", "description": "Backend API", "type": "local", "created": "2026-02-08T12:46:00Z" }, "paths": { "root": "/repos/api-service", "data_dir": "/repos/api-service/.cleveragents" }, "defaults": { "sandbox": "git_worktree", "validations": 0, "context_filters": null, "automation_profile": null }, "resources": { "total": 0, "indexed": 0, "sandboxable": 0 } }, "timing": { "duration_ms": 85 }, "messages": [{ "level": "ok", "text": "Project created" }] } ``` When resources and invariants are provided, the JSON should also include `linked_resources` and `invariants` sections (spec lines 2740–2798). ## Actual Behavior (from code analysis) The `_project_spec_dict()` helper (lines 137–168) returns a flat dict with: ```python { "namespaced_name": ..., "namespace": ..., "name": ..., "description": ..., "linked_resources": [...], "created_at": ..., "updated_at": ... } ``` This is passed directly to `format_output()` for non-rich formats. Missing: - `paths.root` and `paths.data_dir` - `defaults.sandbox`, `defaults.validations`, `defaults.context_filters`, `defaults.automation_profile` - `resources.total`, `resources.indexed`, `resources.sandboxable` - `type` field in the `project` section - `invariants` section when `--invariant` flags are used - Standard response envelope: `command`, `status`, `exit_code`, `timing`, `messages` ## Rich Output Deviation The rich output also deviates from spec. The spec (lines 2554–2579) shows four panels: 1. **Project** — Name, Description, Type, Created 2. **Paths** — Root, Data Dir 3. **Defaults** — Sandbox, Validations, Context Filters, Automation Profile 4. **Resources** — Total, Indexed, Sandboxable The implementation shows a single panel with only Name, Namespace, Description, and Resources count. ## Steps to Reproduce ```bash agents --format json project create --description "Backend API" local/api-service ``` Compare output to spec lines 2611–2644. ## Impact Any tooling or scripts consuming `agents project create --format json` will receive incorrect data structure. The `paths` section is particularly important for automation workflows that need to know where the project data directory was created. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
HAL9000 added this to the v3.2.0 milestone 2026-04-09 15:32:04 +00:00
Author
Owner

Label compliance fix applied:

  • Added missing labels and/or milestone to bring issue into compliance with CONTRIBUTING.md

Automated by CleverAgents Bot
Supervisor: Backlog Grooming | Agent: backlog-groomer

Label compliance fix applied: - Added missing labels and/or milestone to bring issue into compliance with CONTRIBUTING.md --- **Automated by CleverAgents Bot** Supervisor: Backlog Grooming | Agent: backlog-groomer
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.

Reference
cleveragents/cleveragents-core#6111
No description provided.