Commit Graph

22 Commits

Author SHA1 Message Date
freemo 4ad51561fc perf(tests): optimize medium-slow BDD features (10-100s tier)
Cap time.sleep and asyncio.sleep globally at 10ms in before_all to
eliminate retry/backoff waits (tenacity wait_fixed, retry_auto_debug
exponential backoff). Save originals as time._original_sleep and
asyncio._original_sleep for tests that need real wall-clock delays
(CircuitBreaker recovery, debounce timers, validation timeouts).

Enhance template-DB patch: add "db." prefix to _SCENARIO_DB_PREFIXES
and check db_path.stat().st_size > 0 so 0-byte auto-created SQLite
files receive the template copy instead of falling through to real
migrations.

Replace subprocess.run CLI invocations with typer.testing.CliRunner
in module_coverage, main_coverage_complete, and coverage_extras step
files, eliminating ~6s Python cold-start overhead per call.

Switch plan_persistence and action_persistence to in-memory SQLite by
default; only cross-restart scenarios use file-based via an explicit
Given step.

Replace MigrationRunner.run_migrations with Base.metadata.create_all
in plan_service_steps for freshly created in-memory engines.

Removed leftover debug comment in environment.py.

Total tier runtime: 565s -> 21s (96% reduction), 20 features all
under 5s behave-internal time.

ISSUES CLOSED: #480
2026-03-02 02:01:27 +00:00
freemo 0bbec4b77e perf(tests): optimize the 8 slowest BDD feature files
Optimized the 8 features accounting for 64% of total BDD test runtime
(1,505s of 2,352s):

- features/environment.py: Added _ensure_template_db() for direct behave
  invocations, expanded _SCENARIO_DB_PREFIXES to include "test_" for
  step-file-created DBs, added @mock_only tag support to skip
  unnecessary DB setup.
- features/plan_commands_coverage.feature: Added @mock_only tag (fully
  mocked, no DB needed).
- features/plan_service.feature: 14 actor-resolution scenarios now use
  lightweight in-memory plan service instead of heavyweight file-based
  DB + project init.
- features/steps/plan_service_steps.py: New
  step_create_lightweight_plan_service for actor-resolution tests.
- features/steps/services_coverage_steps.py: Extracted 3 helper functions
  to consolidate 8 near-identical Given steps (~200 lines of duplicated
  boilerplate removed).

Per-feature results: services_coverage 245s->2.8s (99%), context_service
215s->2.1s (99%), project_service 140s->0.7s (99%), plan_service
215s->4.6s (98%), core_cli_commands 113s->4.2s (96%), cli_streaming
213s->6.4s (97%), plan_commands_coverage 116s->20s (83%),
cli_plan_context_commands 248s->31.6s (87%).

ISSUES CLOSED: #479
2026-03-02 02:01:27 +00:00
freemo a074b4846f fix(provider): remove FakeListLLM defaults
Remove FakeListLLM as a silent fallback in agent graph constructors
(plan_generation.py, context_analysis.py, auto_debug.py). All three now
raise ValueError when llm=None, making missing-provider errors explicit.

Add Settings.mock_providers flag and validate_provider_availability()
method. Update container.get_ai_provider() to check Settings.mock_providers
first, with env-var fallback for backward compatibility.

Add resolve_provider_by_name() helper to the provider registry and export
it from cleveragents.providers. Add structlog trace logging to
ProviderRegistry.get_default_provider_type() to record selection reasoning.

Update all existing behave step files, robot tests, and benchmarks that
relied on the implicit FakeListLLM default to pass an explicit LLM
instance instead.

Add new BDD tests (features/provider_fixes.feature with 17 scenarios),
Robot Framework integration tests (robot/provider_detection_smoke.robot),
and ASV benchmarks (benchmarks/provider_selection_bench.py).

ISSUES CLOSED: #323
2026-02-27 09:47:10 -05:00
brent.edwards d4a48caeec test(features/steps): fix features that depend on running as user not superuser 2026-02-12 05:23:29 +00:00
brent.edwards c5004ae918 build(features/steps): fix 14 files to match new ruff format 2026-02-12 02:26:03 +00:00
brent.edwards 7ef5ebb695 feat: Add Q0: Pre-commit hooks setup.
This should automatically check for problems on build.
2026-02-10 16:04:17 +00:00
freemo edc566d5ab feat(actor): enforce actor-first plan resolution 2026-01-14 17:35:09 -05:00
freemo 559aa15629 Feat: Wire actor invocation context through plan graph/providers and add streaming CLI coverage. 2025-12-24 18:50:34 -05:00
freemo 65ee1a2e96 Feat: Harden actor configuration handling with unsafe confirmations, graph descriptors, and actor-based plan coverage. 2025-12-23 20:57:14 -05:00
freemo 7430b6e743 Feat: Added basic scaffolding for actors 2025-12-23 17:12:16 -05:00
freemo 01475b1e5b Chore: Removed some stubbed out legacy code that has since been replaced 2025-12-19 18:07:30 -05:00
freemo 34a29d7cc8 Feat: Adding Actors support to database 2025-12-19 12:35:56 -05:00
freemo bf4e4b6382 Feat: Added include and exclude file filters for projects to add files as a resource to a project 2025-12-16 17:20:37 -05:00
freemo 337d78cf92 Feat: Now capturing token usage as well as passing along the streaming command from some providers 2025-12-09 14:23:47 -05:00
freemo d06051f821 Feat Added ability for PlanService to take per-request providers 2025-12-08 17:45:49 -05:00
freemo ea50a939cb Added LangSmith tracing 2025-12-05 21:00:46 -05:00
freemo 641f7c09d9 Fix: Added streaming to context commands 2025-11-26 23:24:46 -05:00
freemo 496f565a57 Chore: Completed stage 1.5 2025-11-24 20:04:18 -05:00
freemo af5093c881 Chore: Got code coverage up to 98% 2025-11-19 22:40:53 -05:00
freemo 4ee19b9977 Feat: Added in memory_service and plan_service features 2025-11-18 17:04:01 -05:00
freemo 6d2f26bef2 Feat: Added in plan and project commands and functionality 2025-11-16 20:38:02 -05:00
freemo d3fb2f9a74 feat: continued with phase 2 adding database migration scripts to the mix 2025-11-13 18:25:24 -05:00