Files
cleveragents-core/robot/plan_diff_artifacts.robot
T
freemo 9f2e7e88b0 feat(plan): add diff review and apply integration
Add PlanApplyService with diff(), artifacts(), persist_apply_summary(),
handle_merge_failure(), and guard_empty_changeset() methods.

- plan diff: renders changeset in rich/plain/json/yaml formats
- plan artifacts: shows plan metadata, changeset summary, sandbox refs
- persist_apply_summary: stores files_changed/validations_run in plan metadata
- handle_merge_failure: transitions plan to error state with conflict details
- guard_empty_changeset: blocks apply on empty changeset (--allow-empty override)

CLI: plan diff and plan artifacts commands with --format flag.
Tests: 20 Behave scenarios, 8 Robot integration tests, 4 ASV benchmarks.
Docs: docs/reference/plan_apply.md with CLI reference.

Implements D0b.apply from the implementation plan.
2026-02-21 10:22:18 -05:00

68 lines
3.3 KiB
Plaintext

*** Settings ***
Documentation Integration tests for plan diff and artifacts output.
... Tests D0b.apply features: diff rendering, artifacts summary,
... empty changeset guard, apply summary persistence, and merge failure handling.
Resource ${CURDIR}/common.resource
Suite Setup Setup Test Environment
Suite Teardown Cleanup Test Environment
*** Variables ***
${HELPER_SCRIPT} robot/helper_plan_diff_artifacts.py
*** Test Cases ***
Plan Diff Renders Changeset Summary
[Documentation] Verify plan diff shows file changes grouped by path
[Tags] diff plan changeset
${result}= Run Process ${PYTHON} ${HELPER_SCRIPT} diff-output cwd=${WORKSPACE}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} diff-output-ok
Plan Artifacts Shows Changeset Metadata
[Documentation] Verify plan artifacts shows changeset ID, sandbox refs, and file list
[Tags] artifacts plan changeset
${result}= Run Process ${PYTHON} ${HELPER_SCRIPT} artifacts-output cwd=${WORKSPACE}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} artifacts-output-ok
Empty Changeset Guard Blocks Apply
[Documentation] Verify apply is blocked when changeset is empty
[Tags] guard plan apply
${result}= Run Process ${PYTHON} ${HELPER_SCRIPT} empty-guard cwd=${WORKSPACE}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} empty-guard-ok
Empty Changeset Guard Allows With Flag
[Documentation] Verify apply proceeds when --allow-empty is set
[Tags] guard plan apply
${result}= Run Process ${PYTHON} ${HELPER_SCRIPT} empty-guard-allow cwd=${WORKSPACE}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} empty-guard-allow-ok
Apply Summary Persistence
[Documentation] Verify apply summary metadata is persisted into plan
[Tags] apply plan metadata
${result}= Run Process ${PYTHON} ${HELPER_SCRIPT} apply-summary cwd=${WORKSPACE}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} apply-summary-ok
Merge Failure Handling
[Documentation] Verify merge failure sets plan to errored with conflict details
[Tags] merge plan error
${result}= Run Process ${PYTHON} ${HELPER_SCRIPT} merge-failure cwd=${WORKSPACE}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} merge-failure-ok
Diff JSON Format Output
[Documentation] Verify diff JSON format includes entries and summary
[Tags] diff plan json
${result}= Run Process ${PYTHON} ${HELPER_SCRIPT} diff-json cwd=${WORKSPACE}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} diff-json-ok
Diff YAML Format Output
[Documentation] Verify diff YAML format includes changeset metadata
[Tags] diff plan yaml
${result}= Run Process ${PYTHON} ${HELPER_SCRIPT} diff-yaml cwd=${WORKSPACE}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} diff-yaml-ok