UAT: Global -v repeatable verbosity flag missing from main CLI callback — spec requires -v through -vvvvv #3927

Open
opened 2026-04-06 07:30:22 +00:00 by freemo · 0 comments
Owner

Metadata

  • Branch: fix/cli-global-verbosity-flag
  • Commit Message: fix(cli): add global -v repeatable verbosity flag to main CLI callback
  • Milestone: None
  • Parent Epic: #397

Summary

The main CLI callback (@app.callback() in src/cleveragents/cli/main.py) does not implement the global -v repeatable verbosity flag required by the specification. The spec requires -v through -vvvvv to control log verbosity globally for any invocation.

Expected Behavior (from spec)

Per docs/specification.md §CLI Reference (line ~400):

-v: Increase log verbosity for a single invocation (repeatable). By default (no -v), only normal command output is shown. Each additional -v raises the verbosity one level:

  • -v = ERROR
  • -vv = WARN
  • -vvv = INFO
  • -vvvv = DEBUG
  • -vvvvv = TRACE

The flag should be a global option on the main callback, affecting all subcommands.

Actual Behavior

The main_callback function in src/cleveragents/cli/main.py (lines 298-344) has no -v flag at all. The callback only accepts --version, --show-secrets, and --format options.

Some individual subcommands (e.g., build at line 539, actor_run.py line 58) have their own --verbose/-v boolean or count flags, but these are not the global repeatable verbosity flag described in the spec.

Root Cause

The global -v count flag was never added to main_callback. The spec requires:

verbose: Annotated[int, typer.Option("--verbose", "-v", count=True)] = 0

...mapped to log levels: 0=FATAL(default), 1=ERROR, 2=WARN, 3=INFO, 4=DEBUG, 5=TRACE.

Steps to Reproduce

agents -vvv plan list  # Should set INFO level, but -v is not recognized globally

Impact

  • Users cannot control log verbosity globally via the CLI
  • The spec-required verbosity escalation (-v through -vvvvv) is not implemented
  • Debugging complex plan executions is impaired

Subtasks

  • Add verbose: Annotated[int, typer.Option("--verbose", "-v", count=True)] = 0 to main_callback
  • Map verbose count to log levels: 0=FATAL, 1=ERROR, 2=WARN, 3=INFO, 4=DEBUG, 5=TRACE
  • Call configure_structlog(log_level=mapped_level) based on verbose count
  • Handle TRACE level registration (depends on TRACE bug fix)
  • Add unit tests (Behave) for verbose flag mapping — all 6 verbosity levels
  • Add integration test (Robot Framework) verifying global flag propagation to subcommands
  • Verify flag does not persist between invocations
  • Run nox (all default sessions), fix any errors
  • Verify coverage >= 97% via nox -s coverage_report

Definition of Done

  • agents -v plan list sets ERROR log level
  • agents -vvvvv plan list sets TRACE log level
  • Unit tests (Behave) cover all 6 verbosity levels (0–5)
  • Integration test (Robot Framework) verifies global flag behaviour
  • All nox stages pass
  • Coverage >= 97%
  • PR merged and issue closed

Backlog note: This issue was discovered during autonomous operation
on milestone v3.6.0. 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/cli-global-verbosity-flag` - **Commit Message**: `fix(cli): add global -v repeatable verbosity flag to main CLI callback` - **Milestone**: None - **Parent Epic**: #397 ## Summary The main CLI callback (`@app.callback()` in `src/cleveragents/cli/main.py`) does not implement the global `-v` repeatable verbosity flag required by the specification. The spec requires `-v` through `-vvvvv` to control log verbosity globally for any invocation. ## Expected Behavior (from spec) Per `docs/specification.md` §CLI Reference (line ~400): > `-v`: Increase log verbosity for a single invocation (repeatable). By default (no `-v`), only normal command output is shown. Each additional `-v` raises the verbosity one level: > - `-v` = ERROR > - `-vv` = WARN > - `-vvv` = INFO > - `-vvvv` = DEBUG > - `-vvvvv` = TRACE The flag should be a global option on the main callback, affecting all subcommands. ## Actual Behavior The `main_callback` function in `src/cleveragents/cli/main.py` (lines 298-344) has no `-v` flag at all. The callback only accepts `--version`, `--show-secrets`, and `--format` options. Some individual subcommands (e.g., `build` at line 539, `actor_run.py` line 58) have their own `--verbose/-v` boolean or count flags, but these are not the global repeatable verbosity flag described in the spec. ## Root Cause The global `-v` count flag was never added to `main_callback`. The spec requires: ```python verbose: Annotated[int, typer.Option("--verbose", "-v", count=True)] = 0 ``` ...mapped to log levels: 0=FATAL(default), 1=ERROR, 2=WARN, 3=INFO, 4=DEBUG, 5=TRACE. ## Steps to Reproduce ```bash agents -vvv plan list # Should set INFO level, but -v is not recognized globally ``` ## Impact - Users cannot control log verbosity globally via the CLI - The spec-required verbosity escalation (`-v` through `-vvvvv`) is not implemented - Debugging complex plan executions is impaired ## Subtasks - [ ] Add `verbose: Annotated[int, typer.Option("--verbose", "-v", count=True)] = 0` to `main_callback` - [ ] Map verbose count to log levels: 0=FATAL, 1=ERROR, 2=WARN, 3=INFO, 4=DEBUG, 5=TRACE - [ ] Call `configure_structlog(log_level=mapped_level)` based on verbose count - [ ] Handle TRACE level registration (depends on TRACE bug fix) - [ ] Add unit tests (Behave) for verbose flag mapping — all 6 verbosity levels - [ ] Add integration test (Robot Framework) verifying global flag propagation to subcommands - [ ] Verify flag does not persist between invocations - [ ] Run `nox` (all default sessions), fix any errors - [ ] Verify coverage >= 97% via `nox -s coverage_report` ## Definition of Done - [ ] `agents -v plan list` sets ERROR log level - [ ] `agents -vvvvv plan list` sets TRACE log level - [ ] Unit tests (Behave) cover all 6 verbosity levels (0–5) - [ ] Integration test (Robot Framework) verifies global flag behaviour - [ ] All nox stages pass - [ ] Coverage >= 97% - [ ] PR merged and issue closed > **Backlog note:** This issue was discovered during autonomous operation > on milestone v3.6.0. 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
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
#397 Epic: Server & Autonomy Infrastructure
cleveragents/cleveragents-core
Reference
cleveragents/cleveragents-core#3927
No description provided.