diff --git a/features/tool_cli.feature b/features/tool_cli.feature index f02607e21..86ee674f3 100644 --- a/features/tool_cli.feature +++ b/features/tool_cli.feature @@ -215,7 +215,7 @@ Feature: Tool and Validation CLI commands Given a mocked validation exists for attaching When I run validation CLI attach "resource/r1" "local/test-val" Then the validation CLI attach should succeed - And the validation CLI output should contain "Attached validation" + And the validation CLI output should contain "Validation Attached" Scenario: Attach validation with project scope Given a mocked validation exists for attaching diff --git a/src/cleveragents/cli/commands/validation.py b/src/cleveragents/cli/commands/validation.py index af2a79408..e27f426fc 100644 --- a/src/cleveragents/cli/commands/validation.py +++ b/src/cleveragents/cli/commands/validation.py @@ -361,13 +361,24 @@ def attach( f"[bold]Resource:[/bold] {resource}" ) - # Add scope if project is specified + # Add scope field if project: panel_content += f"\n[bold]Scope:[/bold] project {project}" + elif plan_id: + panel_content += f"\n[bold]Scope:[/bold] plan {plan_id}" + else: + panel_content += "\n[bold]Scope:[/bold] direct (always active)" # Display the structured panel console.print(Panel(panel_content, title="Validation Attached", expand=False)) + # Add informational note for direct (unscoped) attachments + if not project and not plan_id: + console.print( + "[dim]This validation will run for ALL plans/projects" + " that access this resource.[/dim]" + ) + # Add success indicator console.print("[green]✓ OK Validation attached[/green]")