render_context_set_plain (~49 lines) was completely uncovered because no
existing test exercised the plain output path for context_set. Add a
coverage-boost scenario that uses format "plain" to cover those lines.
Also add a scenario with max_file_size=100 (not divisible by any binary
unit) to cover the _format_size bytes-fallback path (line 36 of
project_context_set.py).
ISSUES CLOSED: #6319
Implemented spec-compliant JSON, YAML, plain, and rich outputs for `agents project context set`. Added BDD coverage verifying the new output structure across formats.\n\nISSUES CLOSED: #6319
Covers uncovered paths in acms_context.py:
- Empty view name rejection (context show error path)
- Clear without filters warning and auto-confirmation path
This improves code coverage by exercising the following functions:
- acms_context_show empty view validation branch (line 91-93)
- acms_context_clear no-filters warning with confirmation bypass (line 215-219)
Closes#9586
- Fix integration test failure: Context Show Validates Empty View Name
- typer.Exit is click.Exit (RuntimeError subclass), not SystemExit
- Robot helper now catches typer.Exit using exit_code attribute
- Helper path insertion now always places clone src at sys.path[0]
to prevent /app/src from shadowing the PR branch source
- Fix information disclosure: CleverAgentsError handler now logs
exception internally via _logger.exception() and shows generic
user-facing message instead of str(e)
- Fix budget utilization: use actual per-tier token counts instead
of hot_count * 100 (fragment count * arbitrary factor)
- Fix type safety: _remove_fragments now uses _TierServiceProtocol
instead of object, enabling proper static type checking
- Fix overly broad except: cancellation handled with early return
instead of catching typer.Exit(0) in the except block
- Add broad glob pattern warning when --path matches > 50 entries
- Remove duplicate HAL 9000 entry from CONTRIBUTORS.md
- Fix Behave steps to catch typer.Exit in addition to SystemExit
ISSUES CLOSED: #9586
The ACMS context CLI commands ('context show' / 'context clear') were fully
implemented in 'acms_context.py' with comprehensive tests, mocks, benchmarks,
and documentation — but the module was never imported or registered in
'cli/main.py'. This commit wires up the 'acms_context.app' Typer sub-app
so that 'agents acms context show' and 'agents acms context clear' are
actually accessible from the CLI.
Changes:
- Import acms_context in _register_subcommands()
- Register acms_context.app as the 'acms' sub-app on the main Typer app
- Add 'acms' to valid_cmds list in main() for fast-path validation
- Add 'acms context' entry to _print_basic_help() output
- Minor formatting cleanup applied by ruff
ISSUES CLOSED: #9586
Refs: #9675
- Rewrote production CLI to use real ContextTierService (get_scoped_view, get_all_fragments, evict_lru) instead of non-existent ACMSService
- Removed unused imports (Path, Panel, ScopedView) from production code
- Fixed all lint issues: trailing whitespace, import ordering, nested with statements
- Replaced typer.Abort() with typer.Exit(code=1) for error exits
- Added input validation for empty/whitespace view parameter
- Fixed error handling to use str(e) instead of e.message
- Added guards against negative budget values in _format_budget_utilization
- Added warning when clearing context with no filters (clear ALL)
- Removed module-level console side effect
- Moved mocks to features/mocks/acms_context_mocks.py per CONTRIBUTING.md
- Fixed test assertions to capture real CLI output (not placeholder)
- Fixed duplicate step definitions (AmbiguousStep errors)
- Fixed feature file step mismatch for tier count parameter
- Added Robot Framework integration tests in robot/acms_context_cli.robot
- Added performance benchmarks in benchmarks/acms_context_cli_bench.py
- Updated CHANGELOG.md with ACMS context CLI feature entry
- Updated CONTRIBUTORS.md with ACMS context CLI contribution
ISSUES CLOSED: #9586
Restore all five required Rich output panels to _print_lifecycle_plan():
- Plan Status panel: Processing State, Projects, Arguments, Automation Profile,
actors (Strategy/Execution/Estimation/Invariant), Execution Environment,
Created/Updated timestamps, Description, Definition of Done, DoD evaluation,
Invariants, resume metadata, multi-project scopes, error message
- Progress panel: Strategize/Execute/Apply step indicators
- Timing panel: Started, Elapsed, ETA (using estimation_result when available),
and all phase timestamps (Strategize Started/Completed, Execute Started/Completed,
Applied At)
- Execution Detail panel: Sandbox, Tool Calls (N/A), Files Modified (N/A),
Child Plans, Checkpoints
- Cost panel: Tokens Used, Cost So Far, Estimated Total Cost
- Footer: ✓ OK Status refreshed
Also fixes:
- tool_calls semantic bug: display N/A instead of total_tokens
- files_modified: display N/A (not available in cost_metadata)
- ETA calculation: use estimation_result.estimated_time_seconds or N/A
- In-function import: moved Plan as LifecyclePlan to top of file
- Import sorting: split aliased import per ruff isort rules
Adds BDD scenarios for all five panels in plan_lifecycle_cli_coverage.feature
with step definitions in plan_lifecycle_cli_coverage_steps.py.
Updates CHANGELOG.md with user-facing output changes.
ISSUES CLOSED: #9341
The artifacts() method routes JSON through format_output() which wraps
the payload in a spec-required envelope {"data": ..., "status": ...}.
The two @tdd_issue_4253 step assertions were checking parsed["key"]
directly, but the actual fields live at parsed["data"]["key"].
Update step_artifacts_json_validation and step_artifacts_json_apply_summary
to extract parsed["data"] before asserting on validation_summary and
apply_summary respectively.
ISSUES CLOSED: #9084
- What was implemented
- Added PLAN_ROLLED_BACK event type to the EventType enum at src/cleveragents/infrastructure/events/types.py to properly represent successful rollbacks in the domain model.
- Implemented rollback_plan(plan_id: str, checkpoint_id: str) -> RollbackResult in PlanLifecycleService (src/cleveragents/application/services/plan_lifecycle_service.py) with:
- Plan state validation: rejects rollback when the plan is in terminal APPLIED or CANCELLED states.
- Delegation to CheckpointService.selective_rollback() to perform the actual rollback logic and obtain a RollbackResult.
- Emission of PLAN_ROLLED_BACK as a domain event to reflect the completed rollback.
- checkpoint_service is accepted as an optional constructor parameter; if not provided, a PlanError is raised to preserve backward compatibility.
- Updated CLI behavior in src/cleveragents/cli/commands/plan.py so agents plan rollback routes through PlanLifecycleService.rollback_plan() rather than calling CheckpointService.selective_rollback() directly.
- Updated PlanLifecycleService module docstring to include rollback_plan in the documented API.
- Added Behave feature file features/plan_lifecycle_rollback.feature with 11 scenarios covering state validation, domain events, and delegation.
- Added step implementations in features/steps/plan_lifecycle_rollback_steps.py to support the new scenarios.
- Key design decisions
- rollback_plan returns RollbackResult (the same result type produced by CheckpointService.selective_rollback) so the CLI can display rollback details consistently.
- Terminal states APPLIED and CANCELLED are disallowed for rollback to prevent inconsistent or invalid state transitions.
- checkpoint_service is optional in the PlanLifecycleService constructor; when omitted (None), a PlanError is raised to retain backward compatibility while signaling explicit dependency requirements.
- CLI UI remains powered by CheckpointService for metadata enrichment (e.g., confirmation prompts), but the actual rollback action is performed via PlanLifecycleService to ensure proper domain workflow and event emission.
- Technical implications
- All rollback logic now flows through the domain service layer (PlanLifecycleService) to preserve invariants and emit domain events, rather than allowing ad-hoc UI routes to bypass service validation.
- The UI can still retrieve checkpoint metadata for user confirmation, but the operation that modifies state uses the new rollback_plan pathway.
- Tests and behavior coverage were expanded via the new Behave feature and step implementations to validate state handling, events, and delegation.
- Affected modules/components
- src/cleveragents/infrastructure/events/types.py
- src/cleveragents/application/services/plan_lifecycle_service.py
- src/cleveragents/cli/commands/plan.py
- PlanLifecycleService module docstring
- features/plan_lifecycle_rollback.feature
- features/steps/plan_lifecycle_rollback_steps.py
ISSUES CLOSED: #3677
- Capture started_at timestamp using datetime.now(UTC) before service call
- Add timing.started field to JSON envelope with ISO 8601 format
- Update step definitions to verify timing.started is present and valid
- Remove @tdd_expected_fail tag from plan_prompt_command.feature scenario
- Remove unrelated files accidentally committed to repo root
- Move datetime import to top of plan_prompt_command_steps.py
- Add CHANGELOG.md entry under [Unreleased] > Fixed
ISSUES CLOSED: #9353
- Capture started_at timestamp using datetime.now(UTC) before service call
- Add timing.started field to JSON envelope with ISO 8601 format
- Update step definitions to verify timing.started is present and valid
- Remove @tdd_expected_fail tag from plan_prompt_command.feature scenario
Fixes#9353
Fix the failing unit tests in agent_task_memory_leak_fix.feature by
replacing the broken event loop management with a persistent background
asyncio event loop running in a daemon thread. The original implementation
called asyncio.create_task() from synchronous Behave step code, which
requires a running event loop — causing RuntimeError: no running event loop.
The fix introduces a _BackgroundLoop class that keeps a dedicated asyncio
event loop alive in a background thread. All agent instantiation and
message sending now happens via asyncio.run_coroutine_threadsafe(), ensuring
the event loop is always running when asyncio.create_task() is called.
Also adds the missing step definition for 'I send {count:d} messages to
the agent' (without 'in rapid succession') to match the feature file.
Updates CONTRIBUTORS.md with the agent task memory leak fix contribution.
ISSUES CLOSED: #9044
This fix addresses issue #9044 by adding a done callback to each asyncio.Task
created in the Agent._setup_processing_pipeline method. The callback removes
the task from the _tasks set upon completion, preventing unbounded memory
growth in long-lived agent instances.
The fix uses task.add_done_callback(self._tasks.discard) to ensure that
completed tasks are promptly removed from the set, allowing them to be
garbage collected. Using set.discard is safe as it never raises ValueError
on double-removal.
ISSUES CLOSED: #9044
- Added input validation for namespace parameter in _handle_registry_list_tools in src/cleveragents/a2a/facade.py: If provided, must be a non-empty string; empty strings raise ValueError; non-string types raise TypeError
- Added input validation for type_name parameter in _handle_registry_list_resources in src/cleveragents/a2a/facade.py: If provided, must be a non-empty string; empty strings raise ValueError; non-string types raise TypeError
- Added input validation for arguments parameter in _handle_plan_create in src/cleveragents/a2a/facade.py: If provided, must be a dict; non-dict types raise TypeError
- Added input validation for created_by parameter in _handle_plan_create in src/cleveragents/a2a/facade.py: If provided, must be a non-empty string; empty strings raise ValueError; non-string types raise TypeError
- Added BDD feature file features/a2a_facade_optional_param_validation.feature with 17 scenarios covering all validation paths
- Added step definitions features/steps/a2a_facade_optional_param_validation_steps.py
ISSUES CLOSED: #9059
The invariant precedence chain is four-tier per specification §92:
plan > action > project > global
This fix updates:
1. Module docstring in invariant.py to document the correct four-tier precedence
2. InvariantScope class docstring to reflect PLAN > ACTION > PROJECT > GLOBAL
3. merge_invariants() function to accept action_invariants parameter
4. InvariantSet.merge() class method to accept and pass action_invariants
5. InvariantService.get_effective_invariants() to collect and pass action invariants
6. BDD test steps to include action invariants in merge operations
7. Benchmark suite to include action invariants in performance tests
8. Robot Framework helper to pass action_invariants to merge functions
9. CHANGELOG.md entry under [Unreleased]/### Fixed section
10. CONTRIBUTORS.md entry documenting HAL 9000 contribution
All docstrings now correctly document the four-tier precedence chain,
and the merge logic properly handles action-scope invariants between
plan and project scopes.
ISSUES CLOSED: #9003
author CleverThis <hal9000@cleverthis.com> 1776170939 +0000
committer CleverThis <hal9000@cleverthis.com> 1776170939 +0000
refactor(agent): replace hardcoded dependency and context file limits with configurable parameters
Implemented configurable limits for the agent and graph components:
- ContextAnalysisAgent now accepts max_dependencies: int = 10 with validation (ValueError if <= 0)
- _parse_dependencies uses self.max_dependencies instead of a hard-coded 10
- PlanGenerationGraph now accepts max_context_files: int = 5 with validation (ValueError if <= 0)
- _format_context_summary uses self.max_context_files instead of a hard-coded 5
- Updated class docstrings to reflect new parameters
- Added Behave feature file at features/agent_configurable_limits.feature with 12 scenarios
- Added step definitions at features/steps/agent_configurable_limits_steps.py
ISSUES CLOSED: #9050
Resource Pydantic model requires resource_id to match the ULID pattern
^[0-9A-HJKMNP-TV-Z]{26}$ and classification to be 'physical' or
'virtual'. The test fixture used '01HANDLER0000000000000001' (invalid
ULID) and 'tool' (invalid enum), causing a ValidationError during
scenario setup that Behave reported as a traceback outside scenario.
Fixes the errored scenario in features/container_clone_into.feature:88.
ISSUES CLOSED: #7555
The devcontainer_handler_protocol_methods.feature file and its step
definitions still referenced the old ContainerLifecycleState.DETECTED
terminology. Update to DISCOVERED for consistency with specification.
ISSUES CLOSED: #7555
Addresses remaining CI review feedback from HAL9001 on PR #8304:
1. Moved all cleveragents imports from inside function bodies to module-level
in features/steps/container_clone_into_steps.py (5 functions fixed)
2. Moved BUILTIN_TYPES import from inside step_look_up_in_builtin_types()
to module level in features/steps/devcontainer_sandbox_strategy_steps.py
3. Removed redundant inline import of EMPTY_CONTENT_HASH and BaseResourceHandler
inside diff() method of devcontainer.py (already available at module level)
4. Fixed stale docstring referencing old 'detected' terminology in
robot/helper_devcontainer_lifecycle.py cmd_transition_valid()
All files pass ruff format and ruff check.
The --clone-into CLI argument was registered and the helper
clone_repo_into_container() was implemented, but DevcontainerHandler.resolve()
never read the clone_into property or called the helper. This meant that
agents resource add container-instance --clone-into <url> silently ignored
the flag at runtime (acceptance criterion #2 from issue #7555 was unmet).
Wire the clone step into DevcontainerHandler.resolve(): after
activate_container() returns and the lifecycle tracker has a container_id,
validate the URL and call clone_repo_into_container(). Also add an
end-to-end BDD scenario that exercises the full handler to clone path via
mocks.
ISSUES CLOSED: #7555
- Change validate_clone_into_url() return type from bool to None
- Raise ValueError for empty or invalid git repository URLs
- Update BDD steps to catch ValueError and set clone_url_valid accordingly
- Aligns with contract requirement from PR #8304 review feedback
- Adds a --clone-into option to the container-instance command to clone repository contents into a specified path during container setup.
- Fixes the devcontainer-instance sandbox strategy to ensure proper isolation, correct mount permissions, and deterministic behavior across environments.
- Updates related validation and error handling to reflect the new option and sandbox changes.
ISSUES CLOSED: #7555
Fixes the four root causes behind PR #8733's red unit_tests + Robot
integration_tests gates after the post-rebase landing of the v3.3.0
spec + invariant enforcement work.
1. Lazy-import module path used a slash instead of a dot — the
`__getattr__` lookup in `application/services/__init__.py` could
never resolve `SubplanSpawnError` because `importlib.import_module`
only accepts dotted module paths. This broke both the
`svcov3 lazy-load SubplanSpawnError` Behave scenario AND the
`Test Services Package Exports` Robot scenario (the
`from cleveragents.application.services import *` star-import walks
`__all__` and trips on the bad entry).
2. `subplan_service_coverage_boost.feature:11` contained the literal
placeholder text `{1:d}` instead of the literal value `1`. Gherkin
does not interpolate `{n:d}` in feature bodies — only in step
patterns — so the existing
`the SubplanSpawnError message should contain {n:d} semicolons`
step could not match.
3. `step_load_invariants_plan_only` used `@when(re.compile(...))`
without `use_step_matcher("re")`, so behave silently treated it as
an undefined step. Switched the file's matcher to `re` for that
single step (auto-anchored, no end marker — behave's `re` matcher
refuses `$`) and back to `parse` for the rest, so it no longer
collides with the parse-matched "with project" variant whose
`{plan_id}` field is greedy.
4. `step_check_action_against_invariants` used the parse field
`{action_text}` which doesn't match empty strings, so the
"Empty action text" scenario reported the When step as undefined.
Extracted the body into `_check_action_against_loaded` and added a
literal-pattern `'I check action "" against loaded invariants'`
step that delegates to it. Both step variants now also write
`context.error` so the shared
`the error message should contain "..."` step in `service_steps.py`
(which reads `context.error`) works against either error type.
5. `step_attempt_strategy_decision` / `step_create_strategy_decision`
only checked `context.strategize_invariants`, which is empty when
the scenario adds a global invariant via `Given` but never runs the
explicit `I start the Strategize phase` step. Added
`_strategize_active_invariants` helper that falls back to all
active invariants on the service — mirrors the same fallback
pattern already used by `_check_action_against_loaded`.
6. `step_winning_scope` in `invariant_reconciliation_actor_steps.py`
only read `context.reconciliation_result`, so reusing the
`the winning invariant for "X" should be from "Y" scope` assertion
in a non-reconciliation scenario errored with AttributeError. Now
falls back to `context.loaded_invariants` (which
`InvariantService.load_active_invariants` already merges with the
plan > project > global precedence the scenario asserts).
Verified locally:
- `unit_tests` gate passes (16504 scenarios, 0 failed, 0 errored).
- `lint` gate passes.
- `Test Services Package Exports` star-import path resolves
`SubplanSpawnError` cleanly via the package `__getattr__`.
ISSUES CLOSED: #8725
Move SubplanSpawnError from local subplan_service definition to centralized
cleveragents.core.exceptions alongside four new spec-defined error types:
SubplanExecutionError, MaxParallelExceededError, and SubplanDepthLimitError.
Per the v3.3.0 specification (AUTO-ARCH-6), all subplan-related errors are
defined in exceptions.py with proper inheritance hierarchy under DomainError/
PlanError/BusinessRuleViolation. The old local SpawnValidationError class has
been replaced with SubplanSpawnError(PlanError) with a simplified constructor
API (message string instead of validation_errors list).
Updates:
- exceptions.py: Added 4 subplan error classes + __all__ entries
- subplan_service.py: Remove local SpawnValidationError, import SubplanSpawnError from exceptions
- services/__init__.py: Update TYPE_CHECKING stub and _LAZY_IMPORTS for new location
- vulture_whitelist.py: Replace old entry with new error class names
- docs/reference/subplan_service.md: Update to reference SubplanSpawnError (v3.3.0)
- features/*.feature + steps: Update test references from SpawnValidationError to SubplanSpawnError
Add comprehensive Subplan System specification defining module boundaries,
data models (Subplan, SubplanResult, SubplanTree), PostgreSQL schema with
indexes, the 8-step spawning algorithm, concurrency control via per-plan
semaphores, and error handling.
Implement invariant loading and enforcement in Strategize phase:
- Add InvariantViolationError exception class
- Add load_active_invariants() and check_invariants() methods to InvariantService
- Add _is_violation heuristic for action/invariant matching
- Add BDD tests with @load_invariants, @check_invariants, etc. tags
ISSUES CLOSED: #8725
The step "I build the decision tree with default options" was already
defined in features/steps/plan_explain_steps.py:268. This caused
behave.step_registry.AmbiguousStep during step loading, which crashed
all 31 parallel workers before any scenario could run (0 scenarios,
31 errored at feature level).
Rename the When step in the TDD feature and its step definition to
"I build the correction TDD test decision tree" — unique across the
entire features/steps/ directory.
ISSUES CLOSED: #8576
The step_tree_json_valid BDD step was asserting a raw list from
format_output, but the function wraps all machine-readable output in
a spec-required envelope dict ({"data": [...]}). This PR fixes the
step to correctly validate the envelope structure (dict with data key)
and removes @tdd_expected_fail from the @tdd_issue_4254 scenario so
it runs as a permanent regression guard.
The code producing decision_id in tree nodes was already correct; only
the test assertion needed fixing.
ISSUES CLOSED: #9096
Apply ruff format to features/steps/auto_debug_prompt_injection_steps.py
and robot/helper_auto_debug_agent_prompt_injection.py to resolve CI lint
failures (missing blank lines between top-level definitions).
- Add _sanitize_user_input() helper that catches PromptInjectionDetected and falls back to wrap_user_content() instead of crashing the agent
- Remove dead code (_bs, _be variables) from all three agent methods
- Use wrap_user_content() for error_analysis (internal LLM output) in _generate_fix() to avoid crashing on the agent's own output
- Add @security @prompt-injection BDD tags to feature file and all scenarios
- Add missing @then("the boundary markers should be present") step definition
- Add Robot Framework integration tests (auto_debug_agent_prompt_injection.robot)
- Update CHANGELOG.md and CONTRIBUTORS.md
ISSUES CLOSED: #9110
- Import PromptSanitizer from cleveragents.application.services.prompt_sanitizer
- Create module-level _SANITIZER instance for prompt boundary markers
- Apply sanitize_and_wrap() to error_msg and code_ctx in _analyze_error()
- Apply sanitize_and_wrap() to error_analysis and code_context in _generate_fix()
- Apply sanitize_and_wrap() to error_message in _validate_fix()
- Augment system prompts with BOUNDARY_INSTRUCTION to inform LLM about markers
- Add comprehensive BDD test scenarios for prompt injection mitigation
- Add step definitions for testing boundary markers and injection attempts
Fixes#9110
Four CI failures fixed:
1. JSON/YAML progress scenarios (features/output_rendering.feature:588 and :1584):
The conflict resolver had preserved master's test assertions expecting
ProgressIndicator elements in JSON/YAML data arrays, but the PR's
_snapshot_to_dict correctly omits them per spec §26936 ("progress is
omitted from JSON output"). Removed the assertions that contradict the
spec-compliant implementation.
2. ColumnDef all-fields scenario (:1885):
Test checked for "col_type" in raw JSON output, but _column_def_to_dict
serialises the field under the key "type" (via Pydantic alias). Changed
assertion to "width_hint" which IS a serialised key in the ColumnDef dict.
3. Rich-with-cursor scenario (:2154):
Step constructed TerminalCapabilities(supports_cursor=True, term=...) using
the old field names — now backward-compat properties, not Pydantic fields.
Pydantic silently ignores unknown kwargs, leaving supports_cursor_movement=False
and causing select_materializer("rich") to return TableMaterializer. Updated
to supports_cursor_movement=True and term_program="xterm-256color".
4. Robot json-all / yaml-all helpers:
Same conflict-resolution issue as #1: helper expected all 10 element types
including "progress" in JSON/YAML data arrays. Removed "progress" from both
expected lists to match the spec-compliant implementation.
Implement the three missing architectural components of the Output Rendering
Framework as specified in issue #917:
1. RendererRegistry (spec §27249-27350): Central registry for format
(MaterializationStrategy, ElementRenderer) pairs with register(),
resolve(), available_formats(), is_registered() methods and a
FormatRegistration model. Built-in formats pre-registered in
default_registry. Replaces hardcoded if/elif chains for format
resolution.
2. ElementRenderer Protocol (spec §26557-26654): Per-element render
methods (render_panel, render_table, render_tree, etc.) plus
serialize() and can_render(). Six concrete implementations:
PlainElementRenderer, ColorElementRenderer, TableElementRenderer,
RichElementRenderer, JsonElementRenderer, YamlElementRenderer.
Each format now has a paired (Strategy, Renderer).
3. TerminalCapabilities (spec §27264-27301): Extended from 4 fields to
all 11 spec-defined fields: width, height, supports_256_color,
supports_truecolor, supports_unicode, supports_alternate_screen,
no_color, plus renames supports_cursor → supports_cursor_movement,
term → term_program. Backward-compatible properties preserved.
Additional fixes:
- ColumnDef serialises column type as 'type' (not 'col_type') per spec
§26199, with alias for backward compatibility
- YAML output uses sort_keys=True per spec §27168
- Progress elements omitted from JSON/YAML per spec §26936
- MaterializationStrategy.bind(renderer, terminal_caps) method added
to protocol and all strategy implementations (SD-19 resolved)
- Updated SD documentation in __init__.py
ISSUES CLOSED: #917
- Fix error suppression in validate_all_commands: log at DEBUG level instead of silently swallowing exceptions
- Fix multi-word command name parsing bug: use command_token_count to skip the full command prefix when extracting positional values
- Add @cli tag to features/cli_docstring_example_validation.feature
- Update CONTRIBUTING.md with CLI docstring example style guide
- Update CHANGELOG.md with entry for automated docstring validation
- Update CONTRIBUTORS.md with contribution entry
- Fix test design flaws: separate Given/When/Then steps per scenario
- Add validate_all_commands test coverage via new Behave scenario
- Fix _extract_positional_args to only count required positional args
Implemented DocstringExampleValidator class in src/cleveragents/cli/docstring_validator.py that validates CLI command docstring examples to ensure positional arguments precede option flags and align with Typer signatures.
Added Behave feature file at features/cli_docstring_example_validation.feature containing scenarios for valid and invalid docstring examples and edge cases.
Added step definitions at features/steps/cli_docstring_example_validation_steps.py implementing Given/When/Then steps to drive validation and report mismatches.
Fixed the problematic docstring in src/cleveragents/cli/commands/plan.py (rollback_plan function) to reflect correct positional argument order and clearer usage.
The validator ensures that docstring examples have positional arguments before option flags, matching the actual Typer command signature.
ISSUES CLOSED: #9106
Expand multi-exception tuples in _compute_actor_impact() to one
exception type per line, satisfying ruff format's layout rules.
Collapse single-argument @when() decorator to one line where it fits.
ISSUES CLOSED: #8567
- Add return type annotation tuple[Any, Any | None] to _get_services()
- Fix _load_config_text() to catch yaml.YAMLError and TypeError instead
of ValueError/AttributeError around yaml.safe_load(), preserving the
user-friendly typer.BadParameter message for malformed YAML input
- Fix _compute_actor_impact() defensive guards to also catch
CleverAgentsError, OperationalError, and ValidationError in addition
to AttributeError/RuntimeError, keeping actor removal resilient when
the database layer is unavailable
- Update CHANGELOG.md with entry under Changed section for issue #8567
- Add features/actor_exception_handling.feature with four Behave scenarios
covering the exception handling contract changes
- Add features/steps/actor_exception_handling_steps.py with step definitions
ISSUES CLOSED: #8567
The generic EC2 fallback iterated over Reservations dicts and called
item.get("InstanceId", "") on each Reservation, which always returned ""
because Reservations have "ReservationId"/"Instances" — not "InstanceId".
Every result had id="" and a malformed ARN.
Add a dedicated handler before the generic fallback that unpacks
response["Reservations"] -> reservation["Instances"] -> InstanceId,
mirroring the pattern used for s3/ecs/eks/iam/lambda/rds.
Also add BDD scenario, step definitions, and mock helper support for
describe_instances returning N instances with non-empty IDs.
ISSUES CLOSED: #1021