fix(cli): add Impact and History panels to action archive output #9192

Open
HAL9000 wants to merge 7 commits from fix/action-archive-output-panels into master

7 Commits

Author SHA1 Message Date
cleveragents-auto 8e8cc9dfe6 chore: worker ruff auto-fix (pre-push lint gate)
CI / load-versions (pull_request) Successful in 17s
CI / push-validation (pull_request) Successful in 26s
CI / helm (pull_request) Successful in 39s
CI / build (pull_request) Successful in 3m27s
CI / lint (pull_request) Successful in 3m49s
CI / quality (pull_request) Successful in 3m55s
CI / typecheck (pull_request) Successful in 4m27s
CI / security (pull_request) Successful in 4m51s
CI / unit_tests (pull_request) Successful in 28m23s
CI / docker (pull_request) Successful in 1m58s
CI / integration_tests (pull_request) Successful in 38m43s
CI / coverage (pull_request) Successful in 12m5s
CI / status-check (pull_request) Successful in 2s
2026-06-19 01:07:17 -04:00
HAL9000 37e9fd8a21 fix(tests): match quoted panel names and unwrap json/yaml envelope in archive feature
The action_cli_archive_output_panels Behave steps used :w (word-only)
parsers for panel and field names, but the feature literals are
quoted strings like "Action Archived" and "Impact" — :w does not
match the quotes, so every assertion step on those scenarios was
undefined and the whole feature errored. Use literal quoted patterns
that capture the inner text. Likewise the state-transition step's
:w parser cannot match the Unicode arrow ("available → archived");
switch to a quoted pattern.

The plan-history fixture stored timestamps.created_at as a bare
MagicMock(), which made _get_action_history's max() comparison
non-deterministic — under CPython it raised inside the archive
command, crashing the CliRunner invocation. Use a real datetime per
plan (descending day offsets) so the comparison is well-defined.

For json/yaml format, format_output wraps the action dict in the
spec-required envelope ({command,status,exit_code,data,timing,
messages}). The "archived" / "impact" / "history" assertions need to
read from envelope["data"], not the top level. Added _unwrap_envelope
helper and updated all six json/yaml then-steps.

ISSUES CLOSED: #9127
2026-06-19 01:07:17 -04:00
HAL9000 159585c5ca test(cli): define missing 'the action CLI is initialized' Background step
The Behave feature features/action_cli_archive_output_panels.feature
uses 'Given the action CLI is initialized' in its Background but no
matching step decorator existed in features/steps/action_cli_steps.py.
Behave reported all 8 scenarios as ERRORED (not failed), with the
nox unit_tests gate failing on exit code 1 while the scenario-failure
counter stayed at 0 — the classic undefined-step signature.

Add a composite step that mirrors the runner + lifecycle-service
patch combo used elsewhere in this steps file so the Background
sets up both context.runner and context.mock_service that the
subsequent Background steps + scenario When/Then steps depend on.

ISSUES CLOSED: #9127
2026-06-19 01:07:17 -04:00
cleveragents-auto c9b815ecfa chore: worker ruff auto-fix (pre-push lint gate) 2026-06-19 01:07:17 -04:00
HAL9000 43ac9571ad fix(cli): add Impact and History panels to action archive output
- Enhanced `agents action archive` to display three rich-formatted panels
- Panel 1 (Action Archived): Shows action name, state transition with Unicode arrow, and timestamp
- Panel 2 (Impact): Shows availability status and dynamically computed active plans count
- Panel 3 (History): Shows total plans, completed, failed, and last used date
- Implemented `_get_action_history()` with specific exception handling and logging
- Implemented `_render_archive_panels()` for rich output rendering
- Support for all output formats (rich, json, yaml) with proper envelope structure
- Graceful fallback to defaults when plan history is unavailable
- Added comprehensive Behave BDD test scenarios in `features/action_cli_archive_output_panels.feature`
- Updated CHANGELOG.md with detailed description of the feature
- Updated CONTRIBUTORS.md with HAL 9000's contribution details

ISSUES CLOSED: #9127
2026-06-19 01:07:17 -04:00
HAL9000 e3eb223606 fix(cli): add Impact and History panels to action archive output
- Render three rich panels (Action Archived, Impact, History) for archive command output
- Compute dynamic active plans count in Impact panel
- Show action execution history (plans, completions, failures) in History panel
- Display Unicode arrow → for state transitions per spec alignment
- Consolidate _get_action_history to avoid redundant service calls
- Use single-pass iteration for plan counting in _get_action_history
- Replace broad except Exception with specific exceptions and logging

ISSUES CLOSED: #9127
2026-06-19 01:06:37 -04:00
HAL9000 59770ff59b fix(cli): add Impact and History panels to action archive output
- Add _get_action_history() helper to gather plan statistics
- Add _render_archive_panels() to render three panels: Action Archived, Impact, History
- Update archive() command to call _render_archive_panels() for rich format
- Include impact and history data in non-rich output formats (json, yaml, plain)
- Panels show action name, state transition, archived timestamp, impact on plans, and usage history
2026-06-19 01:06:37 -04:00