UAT: agents project context inspect --format json data schema missing spec-required uko_graph and active_strategies keys #6813

Open
opened 2026-04-10 02:12:25 +00:00 by HAL9000 · 1 comment
Owner

Background and Context

The agents project context inspect command must return a JSON response with a specific schema. The specification (§ agents project context inspect, JSON tab) defines an exact data structure containing inspection, uko_graph, active_strategies, and budget keys.

Current Behavior

When running agents project context inspect --format json <PROJECT>, the data object contains an implementation-internal structure (from project_context.py lines 1036–1064):

{
  "command": "",
  "data": {
    "project": "...",
    "view": "all",
    "tier_metrics": { "hot_count": 0, "warm_count": 0, "cold_count": 0, ... },
    "tier_budget": { "max_tokens_hot": 8000, "max_decisions_warm": 500, "max_decisions_cold": 5000 },
    "project_fragments": { "total": 0, "by_tier": { "hot": 0, "warm": 0, "cold": 0 } },
    "actor_visibility": { "strategist": 0, "executor": 0, ... },
    "acms_config": { ... },
    "phase_analysis": { ... },
    "fragments": []
  }
}

Missing keys: uko_graph, active_strategies. The budget section has the wrong schema. The command field is always "" (empty string) because format_output() is called without the command= kwarg.

Expected Behavior (from spec)

The spec (§ agents project context inspect JSON tab) requires:

{
  "command": "project context inspect",
  "status": "ok",
  "exit_code": 0,
  "data": {
    "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": [
        { "relation": "contains", "target": "uko-py:class/AuthHandler", "depth": 3, "tokens": 320 },
        ...
      ]
    },
    "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
    }
  },
  "timing": { "duration_ms": 185 },
  "messages": ["Context inspection complete"]
}

Key spec-required data sub-keys: inspection, uko_graph, active_strategies, budget.

Steps to Reproduce

  1. Clone the repo and install the package
  2. Create a project with resources: agents project create local/test-proj
  3. Run: agents project context inspect --format json local/test-proj
  4. Observe: data contains tier_metrics, tier_budget, project_fragments, actor_visibility, acms_config, phase_analysis instead of the spec-required structure
  5. Observe: uko_graph and active_strategies keys are entirely absent
  6. Observe: command field in envelope is "" (empty string)

Code Location

  • src/cleveragents/cli/commands/project_context.py
    • context_inspect() function, lines ~1036–1161
    • format_output(data, output_format) call at line 1161 — missing command="project context inspect" kwarg
    • The data dict built at lines 1036–1064 does not match the spec schema at all

Acceptance Criteria

  • --format json output has inspection, uko_graph, active_strategies, and budget sub-keys as per spec
  • uko_graph contains the UKO graph rooted at --focus URI(s), with edges showing relations and token counts
  • active_strategies lists each active strategy with name, quality, budget_pct, and fragments
  • budget contains model_window, response_reserve, skeleton_reserve, available_budget, used, utilization
  • command envelope field is "project context inspect" (not empty string)

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

## Background and Context The `agents project context inspect` command must return a JSON response with a specific schema. The specification (§ `agents project context inspect`, JSON tab) defines an exact `data` structure containing `inspection`, `uko_graph`, `active_strategies`, and `budget` keys. ## Current Behavior When running `agents project context inspect --format json <PROJECT>`, the `data` object contains an implementation-internal structure (from `project_context.py` lines 1036–1064): ```json { "command": "", "data": { "project": "...", "view": "all", "tier_metrics": { "hot_count": 0, "warm_count": 0, "cold_count": 0, ... }, "tier_budget": { "max_tokens_hot": 8000, "max_decisions_warm": 500, "max_decisions_cold": 5000 }, "project_fragments": { "total": 0, "by_tier": { "hot": 0, "warm": 0, "cold": 0 } }, "actor_visibility": { "strategist": 0, "executor": 0, ... }, "acms_config": { ... }, "phase_analysis": { ... }, "fragments": [] } } ``` Missing keys: `uko_graph`, `active_strategies`. The `budget` section has the wrong schema. The `command` field is always `""` (empty string) because `format_output()` is called without the `command=` kwarg. ## Expected Behavior (from spec) The spec (§ `agents project context inspect` JSON tab) requires: ```json { "command": "project context inspect", "status": "ok", "exit_code": 0, "data": { "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": [ { "relation": "contains", "target": "uko-py:class/AuthHandler", "depth": 3, "tokens": 320 }, ... ] }, "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 } }, "timing": { "duration_ms": 185 }, "messages": ["Context inspection complete"] } ``` Key spec-required `data` sub-keys: `inspection`, `uko_graph`, `active_strategies`, `budget`. ## Steps to Reproduce 1. Clone the repo and install the package 2. Create a project with resources: `agents project create local/test-proj` 3. Run: `agents project context inspect --format json local/test-proj` 4. Observe: `data` contains `tier_metrics`, `tier_budget`, `project_fragments`, `actor_visibility`, `acms_config`, `phase_analysis` instead of the spec-required structure 5. Observe: `uko_graph` and `active_strategies` keys are entirely absent 6. Observe: `command` field in envelope is `""` (empty string) ## Code Location - `src/cleveragents/cli/commands/project_context.py` - `context_inspect()` function, lines ~1036–1161 - `format_output(data, output_format)` call at line 1161 — missing `command="project context inspect"` kwarg - The `data` dict built at lines 1036–1064 does not match the spec schema at all ## Acceptance Criteria - [ ] `--format json` output has `inspection`, `uko_graph`, `active_strategies`, and `budget` sub-keys as per spec - [ ] `uko_graph` contains the UKO graph rooted at `--focus` URI(s), with `edges` showing relations and token counts - [ ] `active_strategies` lists each active strategy with `name`, `quality`, `budget_pct`, and `fragments` - [ ] `budget` contains `model_window`, `response_reserve`, `skeleton_reserve`, `available_budget`, `used`, `utilization` - [ ] `command` envelope field is `"project context inspect"` (not empty string) --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
HAL9000 added this to the v3.5.0 milestone 2026-04-10 02:12:36 +00:00
Author
Owner

Verified — UAT bug: project context inspect JSON missing spec-required uko_graph and active_strategies keys. MoSCoW: Must-have. Priority: High — spec compliance.


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

✅ **Verified** — UAT bug: project context inspect JSON missing spec-required `uko_graph` and `active_strategies` keys. MoSCoW: Must-have. Priority: High — spec compliance. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner-pool-supervisor
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#6813
No description provided.