Commit Graph

3 Commits

Author SHA1 Message Date
freemo 89c215e62c fix(cli): render spec-required panels in agents plan rollback rich output
Implemented a rich output upgrade for the agents plan rollback in the CLI by replacing the previous plain-text output in rollback_plan() with a set of four spec-required Rich panels.

- Rollback Summary panel: includes Plan, Checkpoint, Label (only if available), and Files fields.

- Changes Reverted panel: a Rich table with File and Action columns; supports both dict entries and plain string paths for forward compatibility with issue #2454.

- Impact panel: shows Sandbox state and optional fields Child Plans Invalidated, Decisions After CP, Tool Calls After CP.

- Post-Rollback State panel: includes Phase, State, and optional Checkpoints Remaining fields.

- Confirmation line: "✓ OK Rollback complete" displayed after the panels.

- Tests updated: Updated BDD test assertions in features/plan_cli_coverage_r2.feature to align with new panel-based output.

Key design decisions:

- Used getattr(result, field, None) pattern for optional fields not yet present in RollbackResult model (fields: label, child_plans_invalidated, decisions_after_cp, tool_calls_after_cp, phase, state, checkpoints_remaining) to support forward-compatibility as fields get added.

- Handling mixed formats in changed_paths/changes_reverted: both dict-format entries and string-format paths are supported to remain compatible with issue #2454.

- Sandbox state defaults to "restored to {checkpoint_id}" when not explicitly provided.

Files changed:

- src/cleveragents/cli/commands/plan.py (rollback_plan rich output section)

- features/plan_cli_coverage_r2.feature (updated test assertions)

ISSUES CLOSED: #2591
2026-04-05 17:35:35 +00:00
freemo 48cff5cfe0 refactor(cli): rename plan lifecycle-list and lifecycle-apply to match specification
Renames `plan lifecycle-list` to `plan list` and `plan lifecycle-apply` to `plan apply` to align with the specification's canonical command names. Removes legacy V2 plan commands that occupied those names.

- Renamed CLI command registrations from lifecycle-list/lifecycle-apply to list/apply
- Removed legacy V2 apply and list commands (~200 lines)
- Updated apply shortcut in main.py to delegate to v3 lifecycle
- Added defensive null check for plan existence in apply command
- Updated 63+ test, doc, and benchmark files for consistency

Closes #881

Co-authored-by: Jeffrey Phillips Freeman <the@jeffreyfreeman.me>
Co-committed-by: Jeffrey Phillips Freeman <the@jeffreyfreeman.me>
2026-04-02 19:09:04 +00:00
freemo a808c395f9 test(coverage): add Behave BDD tests to improve unit test coverage across 53 source modules
Add 53 new .feature files and corresponding step definition files targeting
uncovered lines identified in build/coverage.xml. Fix AmbiguousStep conflicts
in 7 pre-existing step files by disambiguating step text.

New tests cover: ACP clients/facade, actor CLI/config, application container,
ACMS service/strategies, async worker, automation profile CLI, autonomy
guardrail, bridge, change model, config CLI/service, context service,
cross-plan correction, database models, decision service, decomposition
clustering/service, discovery handler, langchain chat provider, langgraph
nodes, materializers, multi-project service, plan apply/CLI/lifecycle/model/
preflight/resume/service, PostgreSQL analyzer, project CLI/context CLI,
provider registry, reactive application/route, repositories, resolver handler,
resource registry service, resume model, retry patterns, sandbox protocol,
server CLI, skill CLI/service, skills registry, subplan execution/service,
system CLI, UKO loader, UoW, and YAML template engine.

Closes #645
2026-03-09 13:01:58 -04:00