UAT: agents project context inspect output format does not match spec — missing UKO graph visualization, active strategies, and budget breakdown #3828

Open
opened 2026-04-06 06:49:07 +00:00 by freemo · 1 comment
Owner

Metadata

  • Branch: fix/context-inspect-output-format-spec-alignment
  • Commit Message: fix(cli): align context inspect output with spec §4109-4262 — UKO graph, strategies, budget
  • Milestone: (backlog — no milestone assigned)
  • Parent Epic: #396

Background

The agents project context inspect command's output format significantly deviates from the specification's expected output.

What Was Tested

Code-level analysis of src/cleveragents/cli/commands/project_context.py context_inspect() function against docs/specification.md §4109-4262 (agents project context inspect).

Expected Behavior (from spec §4109-4262)

The spec defines the following output sections for context inspect:

  1. UKO Graph panel: Tree visualization of the UKO subgraph rooted at focus nodes, showing hop neighborhoods with relation types (contains, imports), depth levels, and token counts per node
  2. Active Strategies panel: Table showing each active strategy with quality score, budget percentage, and fragment count
  3. Budget panel: Detailed breakdown including model window, response reserve, tool definitions, system prompt, skeleton reserve, available budget, and used tokens

JSON output should include:

  • inspection object with project, view, focus, breadth, depth, depth_name
  • uko_graph object with root, edges (relation, target, depth, tokens)
  • active_strategies array with name, quality, budget_pct, fragments
  • budget object with model_window, response_reserve, tool_definitions, system_prompt, skeleton_reserve, available_budget, used_tokens

Actual Behavior

The implementation (src/cleveragents/cli/commands/project_context.py, context_inspect() function) shows:

  1. Tier Metrics table: hot_count, warm_count, cold_count, hit/miss counts
  2. Tier Budget panel: max_tokens_hot, max_decisions_warm, max_decisions_cold
  3. Project Fragments summary: total fragments by tier
  4. Actor Visibility panel: fragment counts per actor role
  5. Per-Phase Context Analysis table: fragment_count, resource_count, bytes, tokens, budget per phase
  6. Phase Narrowing panel: narrowing checks

JSON output includes: tier_metrics, tier_budget, project_fragments, actor_visibility, acms_config, phase_analysis, fragments

Code Location

  • src/cleveragents/cli/commands/project_context.pycontext_inspect() function (the entire rich output section)
  • Spec reference: docs/specification.md §4109-4262

Impact

  • Users cannot inspect the UKO graph structure from the CLI
  • Users cannot see which strategies are active and their quality/budget allocation
  • Users cannot see the detailed budget breakdown (model window, skeleton reserve, etc.)
  • The JSON output format is incompatible with any tooling that parses the spec-defined format

Subtasks

  • Implement UKO graph visualization in context_inspect() rich output
  • Add Active Strategies panel showing quality, budget_pct, fragments per strategy
  • Add Budget panel with model_window, response_reserve, tool_definitions, system_prompt, skeleton_reserve, available_budget, used_tokens
  • Update JSON output to match spec format (inspection, uko_graph, active_strategies, budget)
  • Add Behave tests for the new output format

Definition of Done

  • context inspect rich output matches spec §4109-4262 format
  • context inspect JSON output matches spec §4207-4262 format
  • All existing tests pass
  • New Behave tests cover the output format
  • All nox stages pass
  • Coverage >= 97%

Backlog note: This issue was discovered during autonomous UAT testing of the ACMS Context Management feature area. It does not block milestone completion and has been placed in the backlog for human review and future milestone assignment.


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

## Metadata - **Branch**: `fix/context-inspect-output-format-spec-alignment` - **Commit Message**: `fix(cli): align context inspect output with spec §4109-4262 — UKO graph, strategies, budget` - **Milestone**: *(backlog — no milestone assigned)* - **Parent Epic**: #396 ## Background The `agents project context inspect` command's output format significantly deviates from the specification's expected output. ## What Was Tested Code-level analysis of `src/cleveragents/cli/commands/project_context.py` `context_inspect()` function against `docs/specification.md` §4109-4262 (agents project context inspect). ## Expected Behavior (from spec §4109-4262) The spec defines the following output sections for `context inspect`: 1. **UKO Graph panel**: Tree visualization of the UKO subgraph rooted at focus nodes, showing hop neighborhoods with relation types (contains, imports), depth levels, and token counts per node 2. **Active Strategies panel**: Table showing each active strategy with quality score, budget percentage, and fragment count 3. **Budget panel**: Detailed breakdown including model window, response reserve, tool definitions, system prompt, skeleton reserve, available budget, and used tokens JSON output should include: - `inspection` object with project, view, focus, breadth, depth, depth_name - `uko_graph` object with root, edges (relation, target, depth, tokens) - `active_strategies` array with name, quality, budget_pct, fragments - `budget` object with model_window, response_reserve, tool_definitions, system_prompt, skeleton_reserve, available_budget, used_tokens ## Actual Behavior The implementation (`src/cleveragents/cli/commands/project_context.py`, `context_inspect()` function) shows: 1. **Tier Metrics table**: hot_count, warm_count, cold_count, hit/miss counts 2. **Tier Budget panel**: max_tokens_hot, max_decisions_warm, max_decisions_cold 3. **Project Fragments summary**: total fragments by tier 4. **Actor Visibility panel**: fragment counts per actor role 5. **Per-Phase Context Analysis table**: fragment_count, resource_count, bytes, tokens, budget per phase 6. **Phase Narrowing panel**: narrowing checks JSON output includes: `tier_metrics`, `tier_budget`, `project_fragments`, `actor_visibility`, `acms_config`, `phase_analysis`, `fragments` ## Code Location - `src/cleveragents/cli/commands/project_context.py` — `context_inspect()` function (the entire rich output section) - Spec reference: `docs/specification.md` §4109-4262 ## Impact - Users cannot inspect the UKO graph structure from the CLI - Users cannot see which strategies are active and their quality/budget allocation - Users cannot see the detailed budget breakdown (model window, skeleton reserve, etc.) - The JSON output format is incompatible with any tooling that parses the spec-defined format ## Subtasks - [ ] Implement UKO graph visualization in `context_inspect()` rich output - [ ] Add Active Strategies panel showing quality, budget_pct, fragments per strategy - [ ] Add Budget panel with model_window, response_reserve, tool_definitions, system_prompt, skeleton_reserve, available_budget, used_tokens - [ ] Update JSON output to match spec format (inspection, uko_graph, active_strategies, budget) - [ ] Add Behave tests for the new output format ## Definition of Done - [ ] `context inspect` rich output matches spec §4109-4262 format - [ ] `context inspect` JSON output matches spec §4207-4262 format - [ ] All existing tests pass - [ ] New Behave tests cover the output format - All nox stages pass - Coverage >= 97% > **Backlog note:** This issue was discovered during autonomous UAT testing of the ACMS Context Management feature area. It does not block milestone completion and has been placed in the backlog for human review and future milestone assignment. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-new-issue-creator
Author
Owner

Label compliance fix applied:

  • Removed conflicting label: State/Unverified
  • Reason: Issue had both State/In Progress and State/Unverified. Keeping State/In Progress as the more advanced state.

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

Label compliance fix applied: - Removed conflicting label: `State/Unverified` - Reason: Issue had both `State/In Progress` and `State/Unverified`. Keeping `State/In Progress` as the more advanced state. --- **Automated by CleverAgents Bot** Supervisor: Backlog Grooming | Agent: ca-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.

Blocks
#396 Epic: ACMS Context Pipeline
cleveragents/cleveragents-core
Reference
cleveragents/cleveragents-core#3828
No description provided.