- Extract FakeEmbeddings, RelevanceScoringStrategy, AdaptiveContextSelector,
ContextFusionStrategy, and _pack_budget from features/steps/ into new
features/mocks/advanced_context_strategies_mocks.py per mock-placement rules
- Remove sys.path manipulation from robot/helper_advanced_context_strategies.py;
import directly from features.mocks instead of features/steps
- Add None guard before selected.assemble() in step_assemble_context_query
- Add explicit ValueError for unknown strategy types in step_load_yaml_strategy
and load_strategy_from_yaml_impl
ISSUES CLOSED: #7574
The CHANGELOG entry for issue #5566 was dropped during conflict
resolution. Adds the entry back to the [Unreleased] > Fixed section
as required by contributing guidelines.
ISSUES CLOSED: #5566
Restores green unit_tests by removing the duplicate Pydantic virtual-resource
implementation that had no production consumers and was causing behave step
collisions, fixing parse-library step patterns that never matched, and giving
the failing-test scenarios concrete step definitions.
Changes:
- Remove unused parallel implementation `src/cleveragents/domain/models/core/
virtual_resource.py`, its feature file `features/virtual_resource_types.feature`,
and its step file `features/steps/virtual_resource_types_steps.py`. The
canonical `src/cleveragents/resource/virtual.py` (re-exported by
`src/cleveragents/resource/__init__.py`) is the only public API; the
Pydantic copy had zero non-test consumers and its step file duplicated
step text patterns (e.g., `the computed value should be ...`), triggering
`behave.step_registry.AmbiguousStep` errors at module load.
- Fix `VirtualResource.__init__` name validation in
`src/cleveragents/resource/virtual.py`: replace the
`name.replace("-", "").replace("_", "").isalnum()` check with a single
regex `^[a-zA-Z][a-zA-Z0-9_-]*$`. The old check accepted leading digits
(e.g., `"123-invalid"` would strip the hyphen and pass `isalnum()`), so
the "Reject invalid resource names" scenario was silently failing.
- Fix step patterns in `features/steps/resource_virtual_types_steps.py`:
replace unsupported `{name!r}` parse-library syntax with literal-quoted
`"{name}"` (confirmed via `parse.parse(...)` REPL that `!r` returns
`None`); rename the over-broad `it should contain "{text}"` /
`it should raise {error_type} with message containing "{message}"`
patterns to specific forms that don't collide with steps in
`execution_environment_steps.py` and `structural_validation_steps.py`;
add try/except in the `When I compute the virtual resource` step so the
exception-handling scenario can reach its `Then` step.
- Fix table headers in `features/resource_virtual_types.feature` so behave's
table parser sees a proper `| name | value |` header row instead of
treating the first data row as headers.
- Drop the now-unused E501 override for the deleted file from `pyproject.toml`.
- Add CHANGELOG.md entry under `[Unreleased]`.
Verified locally: unit_tests gate against `features/resource_virtual_types.feature`
passes 18/18 scenarios; lint and typecheck both green.
Refs: #8610
- Replace hardcoded gpt-4/openai/gpt-4 references with Resolve LLM Actor
keyword so the test falls back to Anthropic when OpenAI is unavailable
- Add explicit return-code check (rc==0) for actor registration in Step 2
- Update CHANGELOG.md with entry for PR #11191
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
The CHANGELOG.md and CONTRIBUTORS.md entries from db048dd2 claimed this
PR adds `features/pure_graph_coverage.feature`. That standalone file
was intentionally not added (and an earlier draft was removed) because
the PureGraph scenarios already live in
`features/consolidated_langgraph.feature` — adding a standalone file
would have created duplicate Behave scenarios against the same step
definitions and broken `unit_tests` CI.
Reword both entries to accurately describe what this PR delivers:
- the previously orphaned `features/steps/pure_graph_coverage_steps.py`
is now driven through the existing consolidated feature file
- Robot Framework integration tests in `robot/langgraph/pure_graph.robot`
backed by `robot/langgraph/pure_graph_lib.py`
- ASV benchmarks in `benchmarks/pure_graph_bench.py`
ISSUES CLOSED: #9531
Update the PR compliance checklist items that were missing from the original
PR creation by pr-creator:
- Added ### Tests section to CHANGELOG.md documenting the PureGraph BDD,
Robot Framework integration tests, and ASV benchmark additions
- Updated CONTRIBUTORS.md with contribution details for the PureGraph test
coverage suite (PR #9601 / issue #9531)
This completes items [1] and [2] of the mandatory 8-item PR Compliance Checklist.
ISSUES CLOSED: #9531
- Fix acms CLI command hierarchy: nested acms_context.app under main.py
'acms' Typer as 'context' sub-command to form canonical path
[H[2J[3J (was incorrectly at ).
- Warm/cold tier budget labels now say 'decisions' instead of fragments
for clarity (warm/cold use decision budgets, not token budgets).
- Simplify _remove_fragments: ContextTierService is already thread-safe
with RLock; manual lock detection/holding was unnecessary and fragile.
- Update CHANGELOG to clarify warm/cold tiers use decision budget limits.
- 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
- Add changelog entry under [Unreleased]/Fixed for plan artifacts JSON completeness (#9084)
- Add contributors detail for validation_summary and apply_summary fix work.
ISSUES CLOSED: #9084
The prior commits added `timing.started` to a local envelope dict in
`prompt_plan_cmd`, but that dict was passed as the `data` argument to
`format_output()`, which builds its OWN envelope from `data`. Result:
the test-asserted `command="plan prompt"` ended up as an empty string
at the JSON root, and `timing.started` was buried in
`data.timing.started` instead of `timing.started`.
This commit:
- Extends `format_output` and `_build_envelope` with an optional
`started_at: datetime | None` parameter. When provided, the envelope's
`timing` dict includes a `started` ISO-8601 field alongside
`duration_ms`. Backward compatible: default `None` preserves the
existing timing shape for all current callers.
- Refactors `prompt_plan_cmd` to call
`format_output(prompt_data, fmt, command="plan prompt", ...,
started_at=started_at)` for the JSON and YAML formats so the envelope
keys are populated at the document root. Table/plain/color formats
retain the legacy envelope-wrapping behavior — the existing scenario
outline relies on the envelope being passed directly to the table
renderer.
- Removes 48 unrelated files accidentally committed to the repo root
by the original PR commit (`_issue_state.py`, `_pr_dep*.py`,
`_pr_labels.py`, `_pr_setup.py`, `coverage_boost_steps*.py`,
`cross_plan_correction_*.py`, `parse_*.py`, `search_*.py`,
`retry_policy_updated.py`, `run_behave_parallel.py`,
`acms_context_analysis_steps.py`, `aggregate_all.py`,
`check_issues.py`, `check_last_page.py`, `fix_timing.py`,
`helper_cross_plan_correction*.py`, `groom_prompt.txt`,
`label_result.txt`, `prompt_auto_rev_sup.txt`, `tmp/uat_worker_*`,
`tmp/update_issue_labels.sh`). These contained hardcoded API tokens
and broke `ruff format --check`. The exposed token
(`92224acff675c50c5958d1eaca9a688abd405e06`) should be rotated
separately.
- Adds CHANGELOG.md entry under [Unreleased] > Fixed.
ISSUES CLOSED: #9353
Remove @tdd_expected_fail tags from the 3 NamespacedName validation
scenarios and fix step mismatch that caused 2 constructor scenarios to
fail. Constructor scenarios now use the existing "a Pydantic
ValidationError should be raised" step (context_strategy_registry_steps)
which correctly checks pydantic.ValidationError instead of the project's
cleveragents.core.exceptions.ValidationError.
Also remove the duplicate @then step accidentally left in
plan_namespaced_name_tdd_steps.py (would have caused NameError since
the `then` import was already removed).
ISSUES CLOSED: #2145, #2147, #8799
Adds Context Tier Hydration subsection to the ACMS Architecture section of
the specification, documenting the context_tier_hydrator module's public
interface (hydrate_tiers_for_plan, hydrate_tiers_from_project), file listing
strategy (git ls-files for git-checkout resources, os.walk fallback), budget
limits (256 KB per file, 10 MB total per project), and fragment structure
(TieredFragment with ContextTier.HOT placement, metadata keys path/detail_depth/relevance_score).
Also updates CHANGELOG.md under [Unreleased] > Documentation and adds
contribution entry to CONTRIBUTORS.md.
ISSUES CLOSED: #6175
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
- Remove redundant local import of get_container (already imported at module level)
- Add _validate_plan_ulid() call before querying decision service for actionable error messages
- Wrap service calls in try/except catching ValidationError, PlanError, CleverAgentsError
- Add CHANGELOG.md entry for agents plan tree command (#8525)
ISSUES CLOSED: #8525
- 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
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
This TDD scenario documents the gap in Spec Requirement #7: the current
implementation of 'agents plan tree' does not visually distinguish corrected
nodes (decisions with is_correction=True).
The scenario creates a plan with a corrected decision and asserts that the
tree output contains a visual marker such as [corrected] or ✎. The scenario
is tagged @tdd_expected_fail to allow CI to pass while the bug exists.
The Rich tree renderer in tree_decisions_cmd builds node labels without
checking decision.is_correction, proving the gap exists.
- Revert production code change: remove label key and [corrected] marker
from _node_dict in build_decision_tree (the TDD scenario must prove the
bug exists, not fix it; the fix belongs in a separate PR)
- Update CONTRIBUTORS.md with TDD scenario contribution entry
- Add CHANGELOG.md entry for TDD scenario (#8576)
- Remove dead _make_decision() helper (was already removed by prior attempt)
- Remove # type: ignore[import-untyped] (was already removed by prior attempt)
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
- 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
Add domain-scenario Gherkin tags to all A2A, session, and CLI feature
files (30 files) so tests can be filtered individually via behave.
- 8 A2A feature files: @a2a tag
- 7 session feature files: @session tag
- 15 CLI feature files: @cli tag
ISSUES CLOSED: #9124
- 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
- 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 plan correct --format json output already nests correction fields
under data.correction and sets command to "plan correct" via
format_output, so the three BDD scenarios now pass against the current
implementation. Remove the @tdd_expected_fail inversion tag so CI
reports them as passing, not as unexpected-pass failures.
Updated CHANGELOG.md and CONTRIBUTORS.md.
ISSUES CLOSED: #8584
Add MEMORY_ENGINES_LOCK to engine_cache.py and wrap the check-and-set
in UnitOfWork.engine with it to prevent concurrent threads from creating
duplicate in-memory SQLite engines. Also fix cache-hit bug where
self._engine was never assigned on a cache hit.
Closes#7566
Before transitioning to the Apply phase, PlanLifecycleService.apply_plan
now evaluates the plan's definition_of_done criteria using DoDEvaluator
(TextMatchEvaluator). If any required criteria fail, a DoDGatingError is
raised and the plan remains in Execute/COMPLETE state. The evaluation
result is stored in plan.validation_summary with dod_evaluated=True and
dod_all_passed reflecting the outcome. Plans with no DoD text skip
evaluation and proceed normally.
Adds DoDGatingError exception class and _evaluate_dod() helper method.
Adds BDD feature file and step definitions for DoD gating scenarios.
ISSUES CLOSED: #7927
Fixes a race condition (TOCTOU) in ActorLoader.list_actors() where the namespace
filter was applied outside the threading lock, creating a window for concurrent
dictionary modifications. Moving the filter inside the with self._lock: block
ensures atomic reads and filtering.
- Move namespace filtering inside the RLock in list_actors()
- Add concurrency BDD test (threading.Barrier) for list_actors + clear race condition
- Update CHANGELOG.md with fix entry (closes#8588)
- Update CONTRIBUTORS.md with contribution details
ISSUES CLOSED: #8588
Updated docs/specification.md to document the correct JSON/YAML output structure
for the project delete command, replacing the legacy deletion_summary object with
the deleted, success, and deleted_at fields that match the actual implementation
introduced in PR #6639. Added BDD feature file and step definitions to validate
the output format.
ISSUES CLOSED: #7872
Wrapped the `fileConfig()` call in `src/cleveragents/infrastructure/database/migrations/env.py`
with a `try/except` block that catches malformed INI logging configuration and emits
a clear, user-actionable error message to stderr before exiting with code 1.
Includes:
- Error handling guard around fileConfig() in env.py (fileConfig can raise
configparser.Error, KeyError, ValueError on malformed logging config)
- BDD/Behave feature file with 4 scenarios under `features/`
- Step definitions in `features/steps/` for isolated test coverage
- CHANGELOG.md entry under [Unreleased] Fixed section
- CONTRIBUTORS.md update for HAL 9000
ISSUES CLOSED: #7874
Signed-off-by: CleverThis <hal9000@cleverthis.com>
Implementation of the four-level automation profile precedence chain
(plan > action > project > global) as defined in the v3.5.0 specification.
Core implementation (src/):
- PrecedenceSource StrEnum with PLAN, ACTION, PROJECT, GLOBAL levels
- PrecedenceResolution frozen dataclass capturing full resolution state
- resolve_precedence_chain() with plan > action > project > global logic
- _resolve_global_profile() with explicit > env var > default fallback
- Comprehensive debug logging for observability
BDD tests (features/):
- automation_profile_precedence_chain.feature: 30 scenarios covering all
16 combinations of plan/action/project/global configurations plus edge
cases, logging verification, enum values, env var override, and custom registry
- step definitions with proper log handler cleanup via context._cleanup_handlers
CI compliance fixes (bd8b6748):
- ruff format applied to step definitions (fixes CI lint gate)
- CHANGELOG.md updated with accurate 4-level chain description
- test_reports/ artifacts removed; directory added to .gitignore
- tdd_a2a_sdk_dependency.feature reverted to use correct Client import
ISSUES CLOSED: #8234
Added missing CHANGELOG.md entry under [Unreleased] > Fixed section documenting
the AUTO-REV-POOL to AUTO-REV-SUP tracking prefix alignment for the
pr-review-pool-supervisor agent.
Added CONTRIBUTORS.md entry crediting HAL 9000 for the tracking prefix
documentation fix (#7891).
ISSUES CLOSED: #7891
- Delete scripts/fix_uat_tester.py: one-off patch script with a
hardcoded /tmp path that no longer exists. Per CONTRIBUTING.md,
scripts/ is for ongoing-purpose utilities, not development artifacts.
- Remove update_examples_json() from create_documentation_pr(): each
per-PR call was modifying examples.json inside the git clone, causing
merge conflicts when parallel UAT workers created docs PRs
simultaneously. Option A from reviewer: move the call outside the PR
creation function entirely.
- Add batch update_examples_json(documented_examples) call after the
inner docs-PR creation loop completes, guarded by `if documented_examples`.
This runs once per cycle instead of once per PR, eliminating the
examples.json conflict surface for parallel workers.
- Expand CHANGELOG entry to reflect the examples.json fix.
ISSUES CLOSED: #4374
The session create command already emitted a spec-compliant JSON envelope
with messages[].text populated, but list, show, delete, export, and
import did not — they either passed no `messages` to `format_output()`
(producing an envelope with an empty messages array) or short-circuited
to a Rich-styled `console.print(...)` line that breaks JSON parsing
entirely.
Failing scenarios in features/session_cli.feature (unit_tests gate)
asserted `messages[0].text == "<command-specific success>"`. Wire each
command's machine-readable path to emit a structured envelope with the
expected message:
- list (empty) → "0 sessions listed"
- list (populated) → "<N> sessions listed"
- show → "Session details loaded"
- delete --format json|yaml|plain → "Session deleted"
- export --output-format json|yaml|plain → "Export completed"
- import --format json|yaml|plain → "Import completed"
The export command gains a new `--output-format` flag distinct from the
existing `--format` (which selects export content format: json or md).
When the new flag is non-rich, the raw export content is suppressed from
stdout so the envelope remains the only thing emitted, and Rich panels
are skipped.
The import command gains a `--format` flag. The delete command already
had a `--format` option but its non-rich branch emitted Rich-styled text
instead of an envelope; that branch now splits cleanly: `--format color`
keeps the human-readable line, and json/yaml/plain emit an envelope.
Also addresses the `Session create initializes MCP logger` and
`Session list initializes MCP logger` scenarios in
features/session_cli_mcp_logger_simple_execution.feature, which inspect
the create()/list_sessions() source via inspect.getsource() and assert
the literal string `logging.getLogger(_MCP_LOGGER_NAME)` appears. Both
functions held the inlined literal `"cleveragents.mcp"` instead of the
module-level `_MCP_LOGGER_NAME` constant; substitute the constant
reference in both call sites.
CHANGELOG entry extended to document the envelope coverage across all
session commands.
ISSUES CLOSED: #6441
- Fix `security_template_coverage_boost.feature` assertion for "Session
export to stdout outputs JSON": the export path outputs raw JSON with
a `session_id` key, not a `data` envelope, so revert the erroneous
`"data"` assertion back to `"session_id"`.
- Move all deferred `from cleveragents.application.container import
get_container` imports in session.py to the module-level import
block, consistent with every other CLI command file (action.py,
actor.py, config.py, plan.py, etc.). No circular import exists.
- Update `session_cli_uncovered_branches_steps.py` to patch
`cleveragents.cli.commands.session.get_container` directly (the
correct target after a top-level import) instead of replacing
`sys.modules["cleveragents.application.container"]`.
- Add CHANGELOG.md entry for the session create JSON envelope fix.
ISSUES CLOSED: #6441
Add ContextTierService mock to step_m5_invoke_project_context_show
so the CLI command can call _get_context_tier_service() without
failing. Also patch _load_policy_json to prevent JSON decode errors
from MagicMock session objects. Update CHANGELOG.md and CONTRIBUTORS.md.
ISSUES CLOSED: #6323
Extend the JSON/YAML envelope messages[].text fix to cover the remaining
three session subcommands that were still producing plain Rich output
instead of structured envelopes for non-rich format paths:
- session delete: route non-rich formats through format_output() with
messages=[{"level": "ok", "text": "Session deleted"}]
- session export: add --output-format/-f option; emit structured envelope
with session_export/contents/integrity data and "Export completed" message
- session import: add --format/-f option; emit structured envelope with
session_import/validation/merge data and "Import completed" message
Also add BDD scenarios to features/session_cli.feature for each new
envelope path, add corresponding step definitions, add CHANGELOG entry
under [Unreleased] Fixed, and assign milestone v3.2.0 to the PR.
ISSUES CLOSED: #6457
- document the CLI workflow for registering tools, wrapping validations, and querying registry metadata
- index the new example in docs/showcase/examples.json
- re-enable coverage threshold regression checks by removing obsolete tdd_expected_fail tags
ISSUES CLOSED: #4565
Refs: #4305
Refs: #4227
- Delete examples/resource-types/executable.yaml (orphaned artifact referencing
non-existent ExecutableHandler; flagged in 4 prior reviews as blocking)
- Update agents resource list CLI columns from [ID, Name, Type, Status, Kind,
Location, Description] to spec-required [Name, ID, Type, Phys/Virt, Children,
Projects] per specification line 11051
- Lifecycle state for container resources now shown as a note below the table
- Update resource_list_lifecycle_state.feature to remove Status column header
assertions; add spec-column header scenario
- Add BDD scenario in resource_cli.feature verifying new column headers
- Update CHANGELOG.md and CONTRIBUTORS.md
ISSUES CLOSED: #3077