UAT: agents tool show for a Validation does not display spec-required Attached To field showing resource attachments #2066

Open
opened 2026-04-03 03:47:38 +00:00 by freemo · 0 comments
Owner

Metadata

  • Branch: fix/tool-show-validation-attached-to-field
  • Commit Message: fix(cli): display Attached To field for validations in agents tool show
  • Milestone: v3.7.0
  • Parent Epic: #392

Background

The specification (docs/specification.md) states for agents tool show:

"Because Validations are a subtype of Tool and share the same registry, this command also shows validation details. When showing a Validation, additional validation-specific fields are displayed: Mode (required/informational) and Attached To (listing each resource attachment with its scope — direct, project-scoped, or plan-scoped)."

The show command currently retrieves the tool/validation from the registry but does not query the ValidationAttachmentRepository for attachments. The _print_tool() rendering function shows Validation Mode but has no Attached To section, violating the specification.

Steps to Reproduce

  1. Register a validation: agents validation add --config my-validation.yaml
  2. Attach it to a resource: agents validation attach my-resource local/my-validation
  3. Run: agents tool show local/my-validation
  4. Observe: No "Attached To" section appears in the output

Expected Behaviour (from spec)

When agents tool show is called on a Validation, the output must include:

  1. Mode field (required/informational) — Already implemented
  2. Attached To field listing each resource attachment with its scope (direct, project-scoped, or plan-scoped) — Not implemented

Actual Behaviour

The Attached To field is entirely absent from the agents tool show output for Validations.

Code Analysis

  • src/cleveragents/cli/commands/tool.pyshow() only calls service.get_tool(name) but never calls service.list_validations_for_resource() or any attachment query
  • _print_tool() has no Attached To rendering logic
  • ToolRegistryService has list_validations_for_resource() available but it is not called from show

Severity

Medium — users cannot see where a validation is attached from the tool show command, requiring them to check each resource individually.

Subtasks

  • Update show() in src/cleveragents/cli/commands/tool.py to query ValidationAttachmentRepository (or the appropriate service method) for all attachments when the retrieved tool is a Validation
  • Update _print_tool() to render the Attached To section, listing each resource attachment with its scope (direct, project-scoped, or plan-scoped)
  • Write BDD unit tests (Behave/Gherkin) in features/ covering: Validation with no attachments, Validation with one attachment (each scope type), Validation with multiple attachments across scopes
  • Write Robot Framework integration test in robot/ verifying end-to-end agents tool show output for an attached Validation
  • Update any relevant docstrings and inline documentation

Definition of Done

  • agents tool show <NAME> on a Validation displays an Attached To section listing all resource attachments with their scope (direct, project-scoped, plan-scoped)
  • agents tool show <NAME> on a non-Validation Tool is unaffected (no Attached To section rendered)
  • All new code is statically typed; nox -e typecheck passes with zero errors
  • BDD unit tests written in Behave (Gherkin) under features/; no pytest-style unit tests added
  • Robot Framework integration test added under robot/; no mocking used in integration tests
  • All nox stages pass (nox -e lint, nox -e typecheck, nox -e unit_tests, nox -e integration_tests)
  • Coverage >= 97%

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

## Metadata - **Branch**: `fix/tool-show-validation-attached-to-field` - **Commit Message**: `fix(cli): display Attached To field for validations in agents tool show` - **Milestone**: v3.7.0 - **Parent Epic**: #392 ## Background The specification (`docs/specification.md`) states for `agents tool show`: > "Because Validations are a subtype of Tool and share the same registry, this command also shows validation details. When showing a Validation, additional validation-specific fields are displayed: `Mode` (required/informational) and `Attached To` (listing each resource attachment with its scope — direct, project-scoped, or plan-scoped)." The `show` command currently retrieves the tool/validation from the registry but does **not** query the `ValidationAttachmentRepository` for attachments. The `_print_tool()` rendering function shows `Validation Mode` but has no `Attached To` section, violating the specification. ## Steps to Reproduce 1. Register a validation: `agents validation add --config my-validation.yaml` 2. Attach it to a resource: `agents validation attach my-resource local/my-validation` 3. Run: `agents tool show local/my-validation` 4. Observe: No "Attached To" section appears in the output ## Expected Behaviour (from spec) When `agents tool show` is called on a Validation, the output must include: 1. `Mode` field (required/informational) — ✅ Already implemented 2. `Attached To` field listing each resource attachment with its scope (direct, project-scoped, or plan-scoped) — ❌ **Not implemented** ## Actual Behaviour The `Attached To` field is entirely absent from the `agents tool show` output for Validations. ## Code Analysis - `src/cleveragents/cli/commands/tool.py` — `show()` only calls `service.get_tool(name)` but never calls `service.list_validations_for_resource()` or any attachment query - `_print_tool()` has no `Attached To` rendering logic - `ToolRegistryService` has `list_validations_for_resource()` available but it is not called from `show` ## Severity **Medium** — users cannot see where a validation is attached from the `tool show` command, requiring them to check each resource individually. ## Subtasks - [ ] Update `show()` in `src/cleveragents/cli/commands/tool.py` to query `ValidationAttachmentRepository` (or the appropriate service method) for all attachments when the retrieved tool is a Validation - [ ] Update `_print_tool()` to render the `Attached To` section, listing each resource attachment with its scope (direct, project-scoped, or plan-scoped) - [ ] Write BDD unit tests (Behave/Gherkin) in `features/` covering: Validation with no attachments, Validation with one attachment (each scope type), Validation with multiple attachments across scopes - [ ] Write Robot Framework integration test in `robot/` verifying end-to-end `agents tool show` output for an attached Validation - [ ] Update any relevant docstrings and inline documentation ## Definition of Done - [ ] `agents tool show <NAME>` on a Validation displays an `Attached To` section listing all resource attachments with their scope (direct, project-scoped, plan-scoped) - [ ] `agents tool show <NAME>` on a non-Validation Tool is unaffected (no `Attached To` section rendered) - [ ] All new code is statically typed; `nox -e typecheck` passes with zero errors - [ ] BDD unit tests written in Behave (Gherkin) under `features/`; no pytest-style unit tests added - [ ] Robot Framework integration test added under `robot/`; no mocking used in integration tests - [ ] All nox stages pass (`nox -e lint`, `nox -e typecheck`, `nox -e unit_tests`, `nox -e integration_tests`) - [ ] Coverage >= 97% --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-new-issue-creator
freemo added this to the v3.7.0 milestone 2026-04-03 03:47:43 +00:00
freemo self-assigned this 2026-04-03 16:58:11 +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.

Blocks
#392 Epic: Actor YAML & Compiler
cleveragents/cleveragents-core
Reference
cleveragents/cleveragents-core#2066
No description provided.