UAT: agents project context set JSON/YAML output structure does not match spec — missing context_policy, limits, summarization, other_views keys #6319

Open
opened 2026-04-09 20:09:54 +00:00 by HAL9000 · 1 comment
Owner

Summary

The agents project context set command's non-rich output does not match the spec. The implementation dumps the raw ProjectContextPolicy.model_dump() merged with the acms_config dict, while the spec requires a structured output with distinct top-level keys: context_policy, limits, summarization, and other_views.

Spec Reference

docs/specification.md lines 3872–3943 (agents project context set JSON/YAML example).

Expected JSON output:

{
  "command": "project context set",
  "status": "ok",
  "exit_code": 0,
  "data": {
    "context_policy": {
      "project": "local/api-service",
      "view": "strategize",
      "include_resources": ["repo"],
      "exclude_paths": ["**/node_modules/**"]
    },
    "limits": {
      "hot_max_tokens": 12000,
      "warm_max_decisions": 50,
      "cold_max_decisions": 200,
      "query_limit": 20,
      "max_file_size": "1 MB",
      "max_total_size": "50 MB"
    },
    "summarization": {
      "enabled": true,
      "max_tokens": 800
    },
    "other_views": {
      "execute": "(default)",
      "apply": "(default)",
      "default": "(unset)"
    }
  },
  "timing": { "duration_ms": 42 },
  "messages": ["Context policy updated"]
}

Code Location

src/cleveragents/cli/commands/project_context.py:

  • context_set() command (lines 395–758)
  • Lines 745–758: non-rich path:
    data = _policy_to_dict(policy)
    data["acms_config"] = acms
    ...
    console.print(format_output(data, output_format))
    
  • _policy_to_dict() (lines 216–231) — dumps raw default_view, strategize_view, execute_view, apply_view keys

Actual Behavior

Non-rich output is a dump of internal policy structure:

{
  "default_view": { "include_resources": [], "exclude_resources": [], ... },
  "strategize_view": { "include_resources": ["repo"], "exclude_paths": ["**/node_modules/**"], ... },
  "execute_view": null,
  "apply_view": null,
  "acms_config": {
    "hot_max_tokens": 12000,
    "warm_max_decisions": 50,
    ...
  }
}

Missing:

  • Top-level envelope (command, status, exit_code, timing, messages)
  • data.context_policy (project, view, include_resources, exclude_paths in spec-friendly format)
  • data.limits (extracted tier limits with human-readable file sizes)
  • data.summarization (enabled, max_tokens)
  • data.other_views (status of other phase views)

Also: the rich output (lines 747–756) only emits a single "Context policy updated" panel; the spec requires four panels: Context Policy, Limits, Summarization, and Other Views (spec lines 3808–3835).

Steps to Reproduce

Inspect project_context.py lines 745–758 (context_set command, non-rich path).

Expected vs Actual

Field Expected Actual
Top-level {command, status, exit_code, data, timing, messages} Raw policy + acms_config dict
data.context_policy {project, view, include_resources, exclude_paths} Absent (internal view keys used)
data.limits {hot_max_tokens, warm_max_decisions, cold_max_decisions, query_limit, max_file_size, max_total_size} Merged into acms_config
data.summarization {enabled, max_tokens} Merged into acms_config
data.other_views {execute, apply, default} status strings Absent
Rich output 4 panels (Context Policy / Limits / Summarization / Other Views) 1 panel only

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

## Summary The `agents project context set` command's non-rich output does not match the spec. The implementation dumps the raw `ProjectContextPolicy.model_dump()` merged with the `acms_config` dict, while the spec requires a structured output with distinct top-level keys: `context_policy`, `limits`, `summarization`, and `other_views`. ## Spec Reference `docs/specification.md` lines 3872–3943 (`agents project context set` JSON/YAML example). Expected JSON output: ```json { "command": "project context set", "status": "ok", "exit_code": 0, "data": { "context_policy": { "project": "local/api-service", "view": "strategize", "include_resources": ["repo"], "exclude_paths": ["**/node_modules/**"] }, "limits": { "hot_max_tokens": 12000, "warm_max_decisions": 50, "cold_max_decisions": 200, "query_limit": 20, "max_file_size": "1 MB", "max_total_size": "50 MB" }, "summarization": { "enabled": true, "max_tokens": 800 }, "other_views": { "execute": "(default)", "apply": "(default)", "default": "(unset)" } }, "timing": { "duration_ms": 42 }, "messages": ["Context policy updated"] } ``` ## Code Location `src/cleveragents/cli/commands/project_context.py`: - `context_set()` command (lines 395–758) - Lines 745–758: non-rich path: ```python data = _policy_to_dict(policy) data["acms_config"] = acms ... console.print(format_output(data, output_format)) ``` - `_policy_to_dict()` (lines 216–231) — dumps raw `default_view`, `strategize_view`, `execute_view`, `apply_view` keys ## Actual Behavior Non-rich output is a dump of internal policy structure: ```json { "default_view": { "include_resources": [], "exclude_resources": [], ... }, "strategize_view": { "include_resources": ["repo"], "exclude_paths": ["**/node_modules/**"], ... }, "execute_view": null, "apply_view": null, "acms_config": { "hot_max_tokens": 12000, "warm_max_decisions": 50, ... } } ``` Missing: - Top-level envelope (`command`, `status`, `exit_code`, `timing`, `messages`) - `data.context_policy` (project, view, include_resources, exclude_paths in spec-friendly format) - `data.limits` (extracted tier limits with human-readable file sizes) - `data.summarization` (enabled, max_tokens) - `data.other_views` (status of other phase views) Also: the rich output (lines 747–756) only emits a single "Context policy updated" panel; the spec requires four panels: `Context Policy`, `Limits`, `Summarization`, and `Other Views` (spec lines 3808–3835). ## Steps to Reproduce Inspect `project_context.py` lines 745–758 (context_set command, non-rich path). ## Expected vs Actual | Field | Expected | Actual | |-------|----------|--------| | Top-level | `{command, status, exit_code, data, timing, messages}` | Raw policy + acms_config dict | | `data.context_policy` | `{project, view, include_resources, exclude_paths}` | Absent (internal view keys used) | | `data.limits` | `{hot_max_tokens, warm_max_decisions, cold_max_decisions, query_limit, max_file_size, max_total_size}` | Merged into `acms_config` | | `data.summarization` | `{enabled, max_tokens}` | Merged into `acms_config` | | `data.other_views` | `{execute, apply, default}` status strings | Absent | | Rich output | 4 panels (Context Policy / Limits / Summarization / Other Views) | 1 panel only | --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
Author
Owner

Depends on #6626


Automated by CleverAgents Bot
Supervisor: Implementation | Agent: implementation-worker

Depends on #6626 --- **Automated by CleverAgents Bot** Supervisor: Implementation | Agent: implementation-worker
HAL9000 added this to the v3.4.0 milestone 2026-04-10 19:11:25 +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.

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