cc24d8c8ac
Completely removed all legacy plan commands from the CLI:
- Removed tell, build, new, current, cd, continue CLI commands
- Removed programmatic wrapper functions (tell_command, build_command, etc.)
- Removed legacy deprecation message
- Updated help text to indicate V3 Plan Lifecycle exclusively
- Removed stale references to tell/build in help output and command validation
Removes the legacy 'tell' and 'build' CLI shortcuts from main.py:
- Removed echo lines advertising tell/build commands
- Removed tell/build from valid_cmds list
- Removed tell/build from _LIGHTWEIGHT_COMMANDS frozenset
- These dead entries were preventing helpful error messages
Test infrastructure improvements:
- Event bus exception test: Patch the module-level logger during emit() so that
structlog.testing.capture_logs() can capture the logs. Without patching, the
module-level logger created at import time is not captured by the context manager.
- Session create/list commands: Suppress cleveragents.mcp logger to CRITICAL level
during JSON/YAML output formatting to prevent health check warnings with ANSI codes
from being written to stdout before JSON output, which breaks JSON parsing.
- Extended plan_cli_coverage_boost with scenarios for estimation_result,
invariants, execution_environment, validation_summary, and checkpoint
coverage in _plan_spec_dict
Documentation:
- Created docs/Legacy_to_V3_Guide.md with comprehensive migration instructions
- Updated CONTRIBUTING.md to document removal of legacy workflow
- Updated CHANGELOG.md to reference issue #4181 instead of PR #10800
ISSUES CLOSED: #4181
186 lines
6.8 KiB
Plaintext
186 lines
6.8 KiB
Plaintext
*** Settings ***
|
|
Documentation CLI Plan and Context Commands - Robot Framework Tests
|
|
... Comprehensive testing of plan and context workflows
|
|
Resource ${CURDIR}/common.resource
|
|
Library OperatingSystem
|
|
Library Process
|
|
Library String
|
|
Suite Setup Setup Test Environment
|
|
Suite Teardown Cleanup Test Environment
|
|
Test Timeout 900 seconds
|
|
|
|
*** Variables ***
|
|
# ${PYTHON} will be set in Setup Test Environment from common.resource
|
|
# Make sure to call Setup Test Environment before using ${PYTHON}
|
|
${TEST_DIR} ${TEMPDIR}${/}cleveragents_plan_ctx_test
|
|
${PROJECT_NAME} test-project
|
|
|
|
*** Test Cases ***
|
|
Initialize New Project
|
|
[Documentation] Test cleveragents init command
|
|
[Setup] Setup Test Directory
|
|
|
|
${result}= Run Process ${PYTHON} -m cleveragents init ${PROJECT_NAME}
|
|
... cwd=${TEST_DIR} env:CLEVERAGENTS_AUTO_APPLY_MIGRATIONS=true stderr=STDOUT timeout=300s on_timeout=kill
|
|
|
|
Should Be Equal As Integers ${result.rc} 0 Init failed: ${result.stdout}
|
|
Should Exist ${TEST_DIR}${/}.cleveragents
|
|
Should Exist ${TEST_DIR}${/}.cleveragents${/}db.sqlite
|
|
|
|
[Teardown] Cleanup Test Directory
|
|
|
|
Add Files To Context
|
|
[Documentation] Test context-load command
|
|
[Setup] Initialize Test Project
|
|
|
|
# Create test files
|
|
Create File ${TEST_DIR}${/}test.py print('hello')
|
|
Create File ${TEST_DIR}${/}main.py def main(): pass
|
|
|
|
# Add files to context
|
|
${result}= Run Process ${PYTHON} -m cleveragents context-load test.py main.py
|
|
... cwd=${TEST_DIR} timeout=300s on_timeout=kill
|
|
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
|
|
# Verify files are in context
|
|
${result}= Run Process ${PYTHON} -m cleveragents context list
|
|
... cwd=${TEST_DIR} timeout=120s on_timeout=kill
|
|
|
|
Should Contain ${result.stdout} test.py
|
|
Should Contain ${result.stdout} main.py
|
|
|
|
[Teardown] Cleanup Test Directory
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List Context Files
|
|
[Documentation] Test context list command
|
|
[Setup] Initialize Test Project With Context
|
|
|
|
${result}= Run Process ${PYTHON} -m cleveragents context list
|
|
... cwd=${TEST_DIR} timeout=120s on_timeout=kill
|
|
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
Should Contain ${result.stdout} test.py
|
|
Should Contain ${result.stdout} utils.py
|
|
|
|
[Teardown] Cleanup Test Directory
|
|
|
|
Show Context Content
|
|
[Documentation] Test context show command
|
|
[Setup] Initialize Test Project With Context
|
|
|
|
# Show specific file content
|
|
${result}= Run Process ${PYTHON} -m cleveragents context show test.py
|
|
... cwd=${TEST_DIR} timeout=120s on_timeout=kill
|
|
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
Should Contain ${result.stdout} def hello
|
|
|
|
# Also test showing summary (without file argument)
|
|
${result}= Run Process ${PYTHON} -m cleveragents context show
|
|
... cwd=${TEST_DIR} timeout=120s on_timeout=kill
|
|
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
Should Contain ${result.stdout} Context Summary
|
|
Should Contain ${result.stdout} Total files: 2
|
|
|
|
[Teardown] Cleanup Test Directory
|
|
|
|
Remove File From Context
|
|
[Documentation] Test actor context remove command
|
|
[Setup] Initialize Test Project With Context
|
|
|
|
# Remove test.py via canonical path: agents actor context remove
|
|
${result}= Run Process ${PYTHON} -m cleveragents actor context remove test.py
|
|
... cwd=${TEST_DIR} timeout=120s on_timeout=kill
|
|
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
|
|
# Verify removal
|
|
${result}= Run Process ${PYTHON} -m cleveragents actor context list
|
|
... cwd=${TEST_DIR} timeout=120s on_timeout=kill
|
|
|
|
Should Not Contain ${result.stdout} test.py
|
|
Should Contain ${result.stdout} utils.py
|
|
|
|
[Teardown] Cleanup Test Directory
|
|
|
|
Clear All Context
|
|
[Documentation] Test context clear command
|
|
[Setup] Initialize Test Project With Context
|
|
|
|
${result}= Run Process ${PYTHON} -m cleveragents context clear --yes
|
|
... cwd=${TEST_DIR} env:CLEVERAGENTS_AUTO_APPLY_MIGRATIONS=true stderr=STDOUT timeout=120s on_timeout=kill
|
|
|
|
Should Be Equal As Integers ${result.rc} 0 Context clear failed: ${result.stdout}
|
|
|
|
# Verify context is empty
|
|
${result}= Run Process ${PYTHON} -m cleveragents context list
|
|
... cwd=${TEST_DIR} env:CLEVERAGENTS_AUTO_APPLY_MIGRATIONS=true stderr=STDOUT timeout=120s on_timeout=kill
|
|
|
|
Should Not Contain ${result.stdout} test.py
|
|
Should Not Contain ${result.stdout} utils.py
|
|
|
|
[Teardown] Cleanup Test Directory
|
|
|
|
Command Error Handling
|
|
[Documentation] Test error cases for commands
|
|
[Setup] Setup Test Directory
|
|
|
|
# Try to use command without project
|
|
${result}= Run Process ${PYTHON} -m cleveragents plan tell test
|
|
... cwd=${TEST_DIR} stderr=STDOUT timeout=120s on_timeout=kill
|
|
|
|
Should Not Be Equal As Integers ${result.rc} 0
|
|
|
|
[Teardown] Cleanup Test Directory
|
|
|
|
*** Keywords ***
|
|
Setup Test Directory
|
|
[Documentation] Create clean test directory
|
|
${run_id}= Evaluate __import__('uuid').uuid4().hex
|
|
Set Test Variable ${TEST_DIR} ${TEMPDIR}${/}cleveragents_plan_ctx_test_${run_id}
|
|
Set Test Variable ${PROJECT_NAME} test-project-${run_id}
|
|
Set Environment Variable CLEVERAGENTS_TESTING_USE_MOCK_AI true
|
|
Run Keyword And Ignore Error Remove Directory ${TEST_DIR} recursive=True
|
|
Create Directory ${TEST_DIR}
|
|
|
|
Cleanup Test Directory
|
|
[Documentation] Remove test directory and cleanup processes
|
|
# Clean up test directory
|
|
Run Keyword And Ignore Error Remove Directory ${TEST_DIR} recursive=True
|
|
|
|
Initialize Test Project
|
|
[Documentation] Initialize a test project
|
|
Setup Test Directory
|
|
${result}= Run Process ${PYTHON} -m cleveragents init ${PROJECT_NAME}
|
|
... cwd=${TEST_DIR} timeout=300s on_timeout=kill
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
|
|
|
|
|
|
Initialize Test Project With Context
|
|
[Documentation] Initialize project and add files to context
|
|
Initialize Test Project
|
|
Create File ${TEST_DIR}${/}test.py def hello(): pass
|
|
Create File ${TEST_DIR}${/}utils.py import os
|
|
${result}= Run Process ${PYTHON} -m cleveragents context-load test.py utils.py
|
|
... cwd=${TEST_DIR} env:CLEVERAGENTS_AUTO_APPLY_MIGRATIONS=true stderr=STDOUT timeout=120s on_timeout=kill
|
|
Should Be Equal As Integers ${result.rc} 0 context-load failed: ${result.stdout}
|