UAT: agents project context show JSON/YAML output missing current_usage section and wrong top-level structure #6323

Open
opened 2026-04-09 20:10:18 +00:00 by HAL9000 · 0 comments
Owner

Summary

The agents project context show command's non-rich output does not match the spec. The implementation dumps the raw internal policy dict (with default_view, strategize_view, etc. keys) and the acms_config blob, while the spec requires structured context_policy, limits, summarization, and current_usage top-level data keys. The current_usage section (live tier utilisation stats) is entirely absent.

Spec Reference

docs/specification.md lines 4028–4107 (agents project context show JSON/YAML example).

Expected JSON output:

{
  "command": "project context show",
  "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
    },
    "current_usage": {
      "hot_context_tokens": 8420,
      "hot_context_limit": 12000,
      "warm_entries": 12,
      "warm_limit": 50,
      "cold_entries": 47,
      "cold_limit": 200,
      "indexed_resources": 1
    }
  },
  "timing": { "duration_ms": 38 },
  "messages": ["Context policy loaded"]
}

Code Location

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

  • context_show() command (lines 761–915)
  • Lines 803–811 (view specified path): emits {phase, resolved_view, acms_config}
  • Lines 809–811 (no-view path): emits _policy_to_dict(policy) + acms_config
  • Line 914: console.print(format_output(data, output_format)) — passes internal structures directly
  • current_usage is never computed or included anywhere in the function

Actual Behavior

Non-rich output for --view strategize:

{
  "phase": "strategize",
  "resolved_view": {
    "include_resources": ["repo"],
    "exclude_resources": [],
    "include_paths": [],
    "exclude_paths": ["**/node_modules/**"],
    "max_file_size": null,
    "max_total_size": null
  },
  "acms_config": { ... }
}

Without --view:

{
  "default_view": { ... },
  "strategize_view": { ... },
  "execute_view": null,
  "apply_view": null,
  "acms_config": { ... }
}

Missing in both cases:

  • Top-level envelope (command, status, exit_code, timing, messages)
  • data.context_policy in spec format
  • data.limits extracted from acms_config
  • data.summarization extracted from acms_config
  • data.current_usage (hot_context_tokens, hot_context_limit, warm_entries, warm_limit, cold_entries, cold_limit, indexed_resources) — not implemented at all

Also: rich output is missing the Current Usage panel (spec lines 3986–3991).

Steps to Reproduce

Inspect project_context.py lines 761–915 (context_show command).

Expected vs Actual

Field Expected Actual
Top-level {command, status, exit_code, data, timing, messages} Internal dict dump
data.context_policy Spec-format policy resolved_view / internal view keys
data.limits Extracted tier limits Buried in acms_config
data.summarization {enabled, max_tokens} Buried in acms_config
data.current_usage Live tier stats Absent — not computed
Rich Current Usage panel Hot/warm/cold current usage Absent

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

## Summary The `agents project context show` command's non-rich output does not match the spec. The implementation dumps the raw internal policy dict (with `default_view`, `strategize_view`, etc. keys) and the `acms_config` blob, while the spec requires structured `context_policy`, `limits`, `summarization`, and `current_usage` top-level data keys. The `current_usage` section (live tier utilisation stats) is entirely absent. ## Spec Reference `docs/specification.md` lines 4028–4107 (`agents project context show` JSON/YAML example). Expected JSON output: ```json { "command": "project context show", "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 }, "current_usage": { "hot_context_tokens": 8420, "hot_context_limit": 12000, "warm_entries": 12, "warm_limit": 50, "cold_entries": 47, "cold_limit": 200, "indexed_resources": 1 } }, "timing": { "duration_ms": 38 }, "messages": ["Context policy loaded"] } ``` ## Code Location `src/cleveragents/cli/commands/project_context.py`: - `context_show()` command (lines 761–915) - Lines 803–811 (view specified path): emits `{phase, resolved_view, acms_config}` - Lines 809–811 (no-view path): emits `_policy_to_dict(policy)` + `acms_config` - Line 914: `console.print(format_output(data, output_format))` — passes internal structures directly - `current_usage` is never computed or included anywhere in the function ## Actual Behavior Non-rich output for `--view strategize`: ```json { "phase": "strategize", "resolved_view": { "include_resources": ["repo"], "exclude_resources": [], "include_paths": [], "exclude_paths": ["**/node_modules/**"], "max_file_size": null, "max_total_size": null }, "acms_config": { ... } } ``` Without `--view`: ```json { "default_view": { ... }, "strategize_view": { ... }, "execute_view": null, "apply_view": null, "acms_config": { ... } } ``` Missing in both cases: - Top-level envelope (`command`, `status`, `exit_code`, `timing`, `messages`) - `data.context_policy` in spec format - `data.limits` extracted from acms_config - `data.summarization` extracted from acms_config - `data.current_usage` (hot_context_tokens, hot_context_limit, warm_entries, warm_limit, cold_entries, cold_limit, indexed_resources) — not implemented at all Also: rich output is missing the `Current Usage` panel (spec lines 3986–3991). ## Steps to Reproduce Inspect `project_context.py` lines 761–915 (context_show command). ## Expected vs Actual | Field | Expected | Actual | |-------|----------|--------| | Top-level | `{command, status, exit_code, data, timing, messages}` | Internal dict dump | | `data.context_policy` | Spec-format policy | `resolved_view` / internal view keys | | `data.limits` | Extracted tier limits | Buried in `acms_config` | | `data.summarization` | `{enabled, max_tokens}` | Buried in `acms_config` | | `data.current_usage` | Live tier stats | **Absent** — not computed | | Rich `Current Usage` panel | Hot/warm/cold current usage | **Absent** | --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
HAL9000 added this to the v3.4.0 milestone 2026-04-10 02:20:29 +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#6323
No description provided.