UAT: agents plan rollback output missing spec-required fields — label, child_plans_invalidated, decisions_after_cp, tool_calls_after_cp, phase, state, checkpoints_remaining #2455

Open
opened 2026-04-03 18:27:12 +00:00 by freemo · 1 comment
Owner

Metadata

  • Branch: bugfix/sandbox-checkpointing-rollback-result-missing-fields
  • Commit Message: fix(checkpoint): extend RollbackResult domain model with spec-required output fields
  • Milestone: v3.7.0
  • Parent Epic: #401

Summary

The agents plan rollback CLI command output is missing several fields required by the specification (spec lines 15970–15999). The root cause is that the RollbackResult domain model (src/cleveragents/domain/models/core/checkpoint.py, lines 161–186) does not carry the additional data needed to populate these fields, and the CLI output construction in src/cleveragents/cli/commands/plan.py (lines 3366–3384) therefore cannot emit them.

This is distinct from #1424, which addresses field-naming and envelope-structure mismatches. This issue specifically tracks the missing fields that require domain-model changes to supply the underlying data.

Expected Behavior (from spec — lines 15948–16119)

The rollback output must include:

Field Location Description
rollback_summary.label data.rollback_summary Human-readable checkpoint label (e.g., "before auth refactor")
impact.child_plans_invalidated data.impact Count of child plans invalidated by the rollback
impact.decisions_after_cp data.impact Count of decisions discarded (e.g., "2 discarded")
impact.tool_calls_after_cp data.impact Count of tool calls undone (e.g., "5 undone")
post_rollback_state.phase data.post_rollback_state Plan phase after rollback (e.g., "execute")
post_rollback_state.state data.post_rollback_state Plan state after rollback (e.g., "queued (awaiting input)")
post_rollback_state.checkpoints_remaining data.post_rollback_state Count of remaining checkpoints after rollback

Actual Behavior

The implementation in src/cleveragents/cli/commands/plan.py (lines 3366–3384) only outputs:

  • rollback_summary.plan_id, from_checkpoint_id, restored_files_count
  • impact.files_affected (not the spec-required fields)
  • post_rollback_state.active_checkpoint, plan_id (not phase, state, checkpoints_remaining)

The RollbackResult domain model (src/cleveragents/domain/models/core/checkpoint.py, lines 161–186) only carries restored_files_count, changed_paths, and from_checkpoint_id — it does not carry the additional fields needed to populate the spec-required output.

Code Locations

  • src/cleveragents/cli/commands/plan.py lines 3366–3384 — output dict construction in rollback_plan
  • src/cleveragents/domain/models/core/checkpoint.py lines 161–186 — RollbackResult domain model
  • src/cleveragents/application/services/checkpoint_service.py lines 259–368 — rollback_to_checkpoint service method (must be updated to populate new fields)

Steps to Reproduce

  1. Run agents plan rollback --yes <PLAN_ID> <CHECKPOINT_ID>
  2. Observe the output is missing label, child_plans_invalidated, decisions_after_cp, tool_calls_after_cp, phase, state, checkpoints_remaining

Spec Reference

docs/specification.md lines 15948–16119 (agents plan rollback command)

Subtasks

  • Audit RollbackResult model in src/cleveragents/domain/models/core/checkpoint.py (lines 161–186) against spec lines 15948–16119
  • Add label: str field to RollbackResult (checkpoint human-readable label)
  • Add child_plans_invalidated: int field to RollbackResult
  • Add decisions_after_cp: int field to RollbackResult (count of decisions discarded)
  • Add tool_calls_after_cp: int field to RollbackResult (count of tool calls undone)
  • Add phase: str field to RollbackResult (plan phase post-rollback)
  • Add state: str field to RollbackResult (plan state post-rollback)
  • Add checkpoints_remaining: int field to RollbackResult
  • Update rollback_to_checkpoint in checkpoint_service.py (lines 259–368) to query and populate all new fields when constructing RollbackResult
  • Update rollback_plan output dict in plan.py (lines 3366–3384) to emit all new fields in the spec-required locations
  • Write Behave BDD scenarios asserting each new field is present and correctly typed in the RollbackResult domain model
  • Write Behave BDD scenarios asserting the CLI output includes all 7 missing fields
  • Write Robot Framework integration test verifying agents plan rollback output contains all spec-required fields
  • Run nox (all default sessions) and fix any errors
  • Verify coverage >= 97% via nox -s coverage_report

Definition of Done

  • RollbackResult domain model carries all 7 spec-required fields with correct types and static type annotations
  • rollback_to_checkpoint service method populates all new fields from the database/plan state
  • agents plan rollback CLI output includes rollback_summary.label, impact.child_plans_invalidated, impact.decisions_after_cp, impact.tool_calls_after_cp, post_rollback_state.phase, post_rollback_state.state, and post_rollback_state.checkpoints_remaining
  • All new fields pass nox -e typecheck (Pyright) — no # type: ignore suppressions
  • Behave BDD unit tests cover all new model fields and CLI output paths
  • Robot Framework integration test verifies end-to-end output against spec
  • All nox stages pass
  • Coverage >= 97%

Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: ca-uat-tester

## Metadata - **Branch**: `bugfix/sandbox-checkpointing-rollback-result-missing-fields` - **Commit Message**: `fix(checkpoint): extend RollbackResult domain model with spec-required output fields` - **Milestone**: v3.7.0 - **Parent Epic**: #401 ## Summary The `agents plan rollback` CLI command output is missing several fields required by the specification (spec lines 15970–15999). The root cause is that the `RollbackResult` domain model (`src/cleveragents/domain/models/core/checkpoint.py`, lines 161–186) does not carry the additional data needed to populate these fields, and the CLI output construction in `src/cleveragents/cli/commands/plan.py` (lines 3366–3384) therefore cannot emit them. This is distinct from #1424, which addresses field-naming and envelope-structure mismatches. This issue specifically tracks the **missing fields** that require domain-model changes to supply the underlying data. ## Expected Behavior (from spec — lines 15948–16119) The rollback output must include: | Field | Location | Description | |---|---|---| | `rollback_summary.label` | `data.rollback_summary` | Human-readable checkpoint label (e.g., `"before auth refactor"`) | | `impact.child_plans_invalidated` | `data.impact` | Count of child plans invalidated by the rollback | | `impact.decisions_after_cp` | `data.impact` | Count of decisions discarded (e.g., `"2 discarded"`) | | `impact.tool_calls_after_cp` | `data.impact` | Count of tool calls undone (e.g., `"5 undone"`) | | `post_rollback_state.phase` | `data.post_rollback_state` | Plan phase after rollback (e.g., `"execute"`) | | `post_rollback_state.state` | `data.post_rollback_state` | Plan state after rollback (e.g., `"queued (awaiting input)"`) | | `post_rollback_state.checkpoints_remaining` | `data.post_rollback_state` | Count of remaining checkpoints after rollback | ## Actual Behavior The implementation in `src/cleveragents/cli/commands/plan.py` (lines 3366–3384) only outputs: - `rollback_summary.plan_id`, `from_checkpoint_id`, `restored_files_count` - `impact.files_affected` (not the spec-required fields) - `post_rollback_state.active_checkpoint`, `plan_id` (not `phase`, `state`, `checkpoints_remaining`) The `RollbackResult` domain model (`src/cleveragents/domain/models/core/checkpoint.py`, lines 161–186) only carries `restored_files_count`, `changed_paths`, and `from_checkpoint_id` — it does not carry the additional fields needed to populate the spec-required output. ## Code Locations - `src/cleveragents/cli/commands/plan.py` lines 3366–3384 — output dict construction in `rollback_plan` - `src/cleveragents/domain/models/core/checkpoint.py` lines 161–186 — `RollbackResult` domain model - `src/cleveragents/application/services/checkpoint_service.py` lines 259–368 — `rollback_to_checkpoint` service method (must be updated to populate new fields) ## Steps to Reproduce 1. Run `agents plan rollback --yes <PLAN_ID> <CHECKPOINT_ID>` 2. Observe the output is missing `label`, `child_plans_invalidated`, `decisions_after_cp`, `tool_calls_after_cp`, `phase`, `state`, `checkpoints_remaining` ## Spec Reference `docs/specification.md` lines 15948–16119 (`agents plan rollback` command) ## Subtasks - [ ] Audit `RollbackResult` model in `src/cleveragents/domain/models/core/checkpoint.py` (lines 161–186) against spec lines 15948–16119 - [ ] Add `label: str` field to `RollbackResult` (checkpoint human-readable label) - [ ] Add `child_plans_invalidated: int` field to `RollbackResult` - [ ] Add `decisions_after_cp: int` field to `RollbackResult` (count of decisions discarded) - [ ] Add `tool_calls_after_cp: int` field to `RollbackResult` (count of tool calls undone) - [ ] Add `phase: str` field to `RollbackResult` (plan phase post-rollback) - [ ] Add `state: str` field to `RollbackResult` (plan state post-rollback) - [ ] Add `checkpoints_remaining: int` field to `RollbackResult` - [ ] Update `rollback_to_checkpoint` in `checkpoint_service.py` (lines 259–368) to query and populate all new fields when constructing `RollbackResult` - [ ] Update `rollback_plan` output dict in `plan.py` (lines 3366–3384) to emit all new fields in the spec-required locations - [ ] Write Behave BDD scenarios asserting each new field is present and correctly typed in the `RollbackResult` domain model - [ ] Write Behave BDD scenarios asserting the CLI output includes all 7 missing fields - [ ] Write Robot Framework integration test verifying `agents plan rollback` output contains all spec-required fields - [ ] Run `nox` (all default sessions) and fix any errors - [ ] Verify coverage >= 97% via `nox -s coverage_report` ## Definition of Done - [ ] `RollbackResult` domain model carries all 7 spec-required fields with correct types and static type annotations - [ ] `rollback_to_checkpoint` service method populates all new fields from the database/plan state - [ ] `agents plan rollback` CLI output includes `rollback_summary.label`, `impact.child_plans_invalidated`, `impact.decisions_after_cp`, `impact.tool_calls_after_cp`, `post_rollback_state.phase`, `post_rollback_state.state`, and `post_rollback_state.checkpoints_remaining` - [ ] All new fields pass `nox -e typecheck` (Pyright) — no `# type: ignore` suppressions - [ ] Behave BDD unit tests cover all new model fields and CLI output paths - [ ] Robot Framework integration test verifies end-to-end output against spec - [ ] All nox stages pass - [ ] Coverage >= 97% --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-uat-tester
freemo added this to the v3.7.0 milestone 2026-04-03 18:27:17 +00:00
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • MoSCoW: Should Have — Important spec requirement or quality improvement. Should be included in the milestone if possible.

Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: ca-project-owner

Issue triaged by project owner: - **State**: Verified - **MoSCoW**: Should Have — Important spec requirement or quality improvement. Should be included in the milestone if possible. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: ca-project-owner
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.

Reference
cleveragents/cleveragents-core#2455
No description provided.