UAT: agents project context inspect output missing spec-required fields (uko_graph, active_strategies, budget detail) #4761

Open
opened 2026-04-08 18:54:29 +00:00 by HAL9000 · 1 comment
Owner

Bug Report

Feature Area: ACMS — agents project context inspect command

Severity: High — the command output is structurally incomplete vs. the spec, making it useless for its stated purpose of "debugging context quality issues"

What Was Tested

Code-level analysis comparing the context_inspect function in src/cleveragents/cli/commands/project_context.py against the spec's defined output format at docs/specification.md §4109-4323.

Expected Behavior (from spec)

The spec defines the context inspect JSON output (docs/specification.md lines 4209-4256) as:

{
  "inspection": {
    "project": "local/api-service",
    "view": "execute",
    "focus": ["uko-py:module/src.auth"],
    "breadth": 2,
    "depth": 3,
    "depth_name": "MEMBER_SUMMARY"
  },
  "uko_graph": {
    "root": "uko-py:module/src.auth",
    "root_depth": 9,
    "root_depth_name": "FULL_SOURCE",
    "root_tokens": 1240,
    "edges": [...]
  },
  "active_strategies": [
    { "name": "breadth-depth-navigator", "quality": 0.85, "budget_pct": 0.45, "fragments": 4 },
    { "name": "semantic-embedding", "quality": 0.60, "budget_pct": 0.35, "fragments": 6 },
    { "name": "simple-keyword", "quality": 0.30, "budget_pct": 0.20, "fragments": 3 }
  ],
  "budget": {
    "model_window": 128000,
    "response_reserve": 4096,
    "tool_definitions": 2400,
    "system_prompt": 1200,
    "skeleton_reserve": 18046,
    "skeleton_ratio": 0.15,
    "available_budget": 102258,
    "used": 1990,
    "utilization": 0.019
  }
}

The Rich output should also show:

  • A "UKO Graph (2-hop neighborhood)" panel with the graph structure
  • An "Active Strategies" panel showing strategy name, quality, budget%, and fragment count
  • A "Budget" panel showing model window, response reserve, tool definitions, system prompt, skeleton reserve, available budget, and utilization

Actual Behavior

The implementation (src/cleveragents/cli/commands/project_context.py lines 918-1161) returns:

data = {
    "project": project,
    "view": view or "all",
    "tier_metrics": {...},
    "tier_budget": {"max_tokens_hot": ..., "max_decisions_warm": ..., "max_decisions_cold": ...},
    "project_fragments": {"total": ..., "by_tier": {...}},
    "actor_visibility": {...},
    "acms_config": {...},
    "phase_analysis": {...},
    "fragments": [...]
}

Missing fields:

  • uko_graph — no UKO graph structure is returned at all
  • active_strategies — no per-strategy quality/budget/fragment breakdown
  • budget.model_window — model context window size
  • budget.response_reserve — tokens reserved for response
  • budget.tool_definitions — tokens consumed by tool definitions
  • budget.system_prompt — tokens consumed by system prompt
  • budget.skeleton_reserve — tokens reserved for skeleton
  • budget.available_budget — computed available budget
  • budget.utilization — fraction of budget used
  • inspection.depth_name — named level for the current depth

The Rich output also lacks the "UKO Graph" and "Active Strategies" panels that the spec shows.

Impact

  • The context inspect command cannot be used for its primary purpose: "debugging context quality issues"
  • Users cannot see which strategies are active, how budget is allocated, or what the UKO graph looks like
  • The budget panel shows raw tier limits instead of the computed available budget breakdown

Code Location

src/cleveragents/cli/commands/project_context.pycontext_inspect() function (lines 918-1161)

Fix Required

The context_inspect function needs to:

  1. Query the UKO graph for focus nodes and return the uko_graph structure
  2. Query active strategies and return per-strategy quality/budget/fragment data
  3. Compute and return the detailed budget breakdown (model_window, response_reserve, tool_definitions, system_prompt, skeleton_reserve, available_budget, utilization)
  4. Add depth_name to the inspection section by resolving the depth integer via the active DetailLevelMap
  5. Add "UKO Graph" and "Active Strategies" panels to the Rich output

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

## Bug Report **Feature Area:** ACMS — `agents project context inspect` command **Severity:** High — the command output is structurally incomplete vs. the spec, making it useless for its stated purpose of "debugging context quality issues" ### What Was Tested Code-level analysis comparing the `context_inspect` function in `src/cleveragents/cli/commands/project_context.py` against the spec's defined output format at `docs/specification.md` §4109-4323. ### Expected Behavior (from spec) The spec defines the `context inspect` JSON output (`docs/specification.md` lines 4209-4256) as: ```json { "inspection": { "project": "local/api-service", "view": "execute", "focus": ["uko-py:module/src.auth"], "breadth": 2, "depth": 3, "depth_name": "MEMBER_SUMMARY" }, "uko_graph": { "root": "uko-py:module/src.auth", "root_depth": 9, "root_depth_name": "FULL_SOURCE", "root_tokens": 1240, "edges": [...] }, "active_strategies": [ { "name": "breadth-depth-navigator", "quality": 0.85, "budget_pct": 0.45, "fragments": 4 }, { "name": "semantic-embedding", "quality": 0.60, "budget_pct": 0.35, "fragments": 6 }, { "name": "simple-keyword", "quality": 0.30, "budget_pct": 0.20, "fragments": 3 } ], "budget": { "model_window": 128000, "response_reserve": 4096, "tool_definitions": 2400, "system_prompt": 1200, "skeleton_reserve": 18046, "skeleton_ratio": 0.15, "available_budget": 102258, "used": 1990, "utilization": 0.019 } } ``` The Rich output should also show: - A "UKO Graph (2-hop neighborhood)" panel with the graph structure - An "Active Strategies" panel showing strategy name, quality, budget%, and fragment count - A "Budget" panel showing model window, response reserve, tool definitions, system prompt, skeleton reserve, available budget, and utilization ### Actual Behavior The implementation (`src/cleveragents/cli/commands/project_context.py` lines 918-1161) returns: ```python data = { "project": project, "view": view or "all", "tier_metrics": {...}, "tier_budget": {"max_tokens_hot": ..., "max_decisions_warm": ..., "max_decisions_cold": ...}, "project_fragments": {"total": ..., "by_tier": {...}}, "actor_visibility": {...}, "acms_config": {...}, "phase_analysis": {...}, "fragments": [...] } ``` **Missing fields:** - `uko_graph` — no UKO graph structure is returned at all - `active_strategies` — no per-strategy quality/budget/fragment breakdown - `budget.model_window` — model context window size - `budget.response_reserve` — tokens reserved for response - `budget.tool_definitions` — tokens consumed by tool definitions - `budget.system_prompt` — tokens consumed by system prompt - `budget.skeleton_reserve` — tokens reserved for skeleton - `budget.available_budget` — computed available budget - `budget.utilization` — fraction of budget used - `inspection.depth_name` — named level for the current depth The Rich output also lacks the "UKO Graph" and "Active Strategies" panels that the spec shows. ### Impact - The `context inspect` command cannot be used for its primary purpose: "debugging context quality issues" - Users cannot see which strategies are active, how budget is allocated, or what the UKO graph looks like - The budget panel shows raw tier limits instead of the computed available budget breakdown ### Code Location `src/cleveragents/cli/commands/project_context.py` — `context_inspect()` function (lines 918-1161) ### Fix Required The `context_inspect` function needs to: 1. Query the UKO graph for focus nodes and return the `uko_graph` structure 2. Query active strategies and return per-strategy quality/budget/fragment data 3. Compute and return the detailed `budget` breakdown (model_window, response_reserve, tool_definitions, system_prompt, skeleton_reserve, available_budget, utilization) 4. Add `depth_name` to the inspection section by resolving the depth integer via the active DetailLevelMap 5. Add "UKO Graph" and "Active Strategies" panels to the Rich output --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • Priority: Medium — spec compliance bug identified by UAT testing
  • Story Points: 3 (M) — targeted fix to align implementation with spec
  • MoSCoW: Must Have — spec compliance is required for correct system behavior

Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: project-owner

Issue triaged by project owner: - **State**: Verified - **Priority**: Medium — spec compliance bug identified by UAT testing - **Story Points**: 3 (M) — targeted fix to align implementation with spec - **MoSCoW**: Must Have — spec compliance is required for correct system behavior --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner
HAL9000 added this to the v3.5.0 milestone 2026-04-09 03:04:48 +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#4761
No description provided.