Files
cleveragents-core/CHANGELOG.md
T

52 KiB
Raw Blame History

Changelog

Unreleased

  • Added four CLI-based integration test cases to M5 E2E verification suite for v3.4.0 milestone acceptance criteria validation. Tests exercise project create, resource add git-checkout, project link-resource, and project show via real subprocess calls to python -m cleveragents with per-test workspace isolation. (#496)
  • Fixed ProjectResourceLinkRepository.create_link() and remove_link() only calling session.flush() without session.commit(), causing linked resource data to be lost between sessions. Added finally: session.close() to both methods to match the session-factory lifecycle pattern used by all other mutating repository methods. (#496)
  • Fixed agents plan execute always using local-only stub actors that returned empty changesets instead of invoking real LLM providers. The CLI command only performed phase transitions (Strategize → Execute) without ever running the PlanExecutor to drive the strategize or execute actors. Added _get_plan_executor() helper that resolves ProviderRegistry from the DI container and constructs LLMStrategizeActor / LLMExecuteActor for real LLM calls. Updated execute_plan CLI to detect plan phase/state and automatically invoke the appropriate actor: strategize actor when the plan is in Strategize/queued, phase transition for Strategize/complete, and execute actor for Execute/queued. Existing mock-based tests remain backward-compatible via duck-typing fallback. New llm_actors.py module provides LLMStrategizeActor (task decomposition) and LLMExecuteActor (code generation) that resolve provider/model actor names to LangChain LLM instances. PlanExecutor.__init__ now accepts optional strategize_actor and execute_actor parameters with stub defaults. (#960)
  • Fixed agents action create missing the --format/-f flag. All other action subcommands (list, show, archive) already accepted --format and routed through _print_action(), but create was the only one omitted. Running action create --config action.yaml --format plain previously failed with a Typer unrecognized-option error. Added the fmt parameter to the create() function signature and wired it to _print_action(). (#959)
  • Added E2E acceptance test for M2 (v3.1.0): Actor Compiler + Full LLM Integration. Robot Framework test suite robot/e2e/m2_acceptance.robot exercises actor YAML compilation into functional graphs, skill registry, tool lifecycle, and plan execution with a custom actor using real LLM API keys. Test flow: create temp git repo → register custom actor → register resource and project → create action → run full plan lifecycle (use → execute strategize → execute → diff → apply) → verify actor compilation and plan integrity. Uses [Tags] E2E, Skip If No LLM Keys, and flexible structural assertions with expected_rc=None for LLM-dependent commands. (#742)
  • Fixed agents session list, agents session create, and other session subcommands raising AttributeError: 'DynamicContainer' object has no attribute 'db' after agents init. Root cause: _get_session_service() called container.db() but no db provider existed. Added a session_service DI provider in container.py that builds the engine, sessionmaker, and auto-committing repositories. Rewrote _get_session_service() to resolve via the container with module-level caching. Added auto_commit parameter to SessionRepository and SessionMessageRepository to prevent resource leaks in CLI context while preserving Unit-of-Work semantics. Unified error handling across all 7 session subcommands. Includes Behave BDD regression scenarios, Robot Framework integration smoke tests, and structlog isolation for parallel test execution. (#554, #570, #680)
  • Added Robot Framework E2E acceptance test for M1 (v3.0.0) milestone. Tests the complete plan lifecycle (action create → resource add → project create → plan use → plan execute strategize → plan execute → plan diff → plan apply) with real LLM API keys and no mocking. Gracefully skips when API keys are absent. (#741)
  • Added dedicated E2E test infrastructure: new nox -s e2e_tests session running Robot Framework with --include E2E tag filter against robot/e2e/ directory, dedicated CI job with real LLM API key secrets, graceful skip when API keys are absent, and --exclude E2E on the standard integration test session. Includes a minimal smoke test exercising agents --version and agents --help. (#740)
  • Implemented tdd_expected_fail tag handling in Robot Framework via a Listener v3 module (robot/tdd_expected_fail_listener.py). Tests tagged tdd_expected_fail that fail have their result inverted to pass (expected failure); tests that unexpectedly pass are reported as failed with guidance to remove the tag. Tag validation enforces tdd_bug + tdd_bug_<N> prerequisites. Includes idempotency guard against double-invocation, explicit SKIP status handling, and a close() hook for clean teardown. Listener is registered in the nox integration_tests and slow_integration_tests sessions. Fixture files are excluded from the main pabot runner via tdd_fixture tag. Includes 9 Robot Framework integration test cases. (#628)
  • Added TDD-style failing Behave BDD tests for the session list DI container missing db provider bug. Three scenarios exercise session list, _get_session_service(), and session list --format json through the real DI path. Includes Robot Framework smoke tests and ASV benchmarks. Tests are intentionally failing (@tdd_expected_fail) until the bug fix for #554 is applied. (#631)
  • Added TDD-style failing Behave BDD tests for the session create DI container missing db provider bug. Three scenarios exercise session create, session create --actor, and session create --format json through the real DI path. Includes Robot Framework smoke tests and ASV benchmarks. Tests are intentionally failing (@tdd_expected_fail) until the bug fix for #570 is applied. (#630)
  • Implemented UKO Layer 2 paradigm vocabulary specializations: Object-Oriented (uko-oo:), Functional (uko-func:), and Procedural (uko-proc:). Added OWL/Turtle class and property definitions for all three paradigms in docs/ontology/uko.ttl. Implemented DetailLevelMapBuilder with insertion and integer reassignment logic for extending parent DetailLevelMaps. ParadigmVocabulary, VocabularyClass, VocabularyProperty, and VocabularyRegistry frozen Pydantic models provide the Python API. Includes Behave BDD tests (60+ scenarios), Robot Framework integration helper, ASV benchmarks for DetailLevelMap operations, and reference documentation. Breaking: DetailLevelMap.effective_levels() now returns MappingProxyType[str, int] (read-only) instead of dict[str, int]; callers that mutated the returned mapping must copy to a dict first. (#575, PR #657)
  • Implemented UKO Layer 3 technology-specific vocabulary extensions for Python (uko-py:), TypeScript (uko-ts:), Rust (uko-rs:), and Java (uko-java:). Each vocabulary defines OWL classes, properties, Layer 2 dependencies, and DetailLevelMap insertions per specification lines 44405-44420. Python inserts 3 new depth levels (DECORATED_SIGNATURES, TYPE_STUBS, WITH_TESTS) producing a 15-level effective map; TS/RS/Java extend at SIGNATURES level without new insertions. Includes OWL/Turtle ontology files, ProvenanceInfo model with 2 required fields (source_resource, source_path) and 3 defaulted fields (source_range, valid_from, is_current), build_detail_level_map/resolve_detail_level utilities, and full Behave BDD tests (78 scenarios, 200 steps). (#576)
  • Added RepoIndexingService for repository file indexing with incremental refresh, extension-based language detection, SHA-256 content hashing, and token estimation. Supports policy enforcement via include/exclude globs, max file size, and max total size limits from project ContextConfig. Persists index metadata and per-file records to SQLite via RepoIndexModel and IndexedFileModel. Domain models (IndexStatus, FileRecord, IndexMetadata, RepoIndex) are frozen Pydantic v2 with ULID IDs and UTC datetimes. Wired into the DI container. Includes 28 Behave BDD scenarios, 3 Robot Framework integration tests, ASV benchmarks (5 time + 2 track), and reference documentation. (#195)
  • Wired retry policies and circuit breakers into the service layer. RetryPolicyConfig and CircuitBreaker models govern per-service retry behaviour (max attempts, backoff strategy, delay bounds, jitter) and circuit breaker protection (failure threshold, recovery timeout, half-open probing, cooldown). ServiceRetryWiring initialises from Settings, creates CircuitBreaker instances per service, and exposes execute()/async_execute() helpers. retry_service_operation decorator adds retry + circuit breaker to any service method via a single annotation. Structured logs are emitted on every retry attempt and when a circuit breaker opens. Retry amplification is prevented by a contextvars nesting guard. Per-service overrides are loaded from the retry_service_overrides JSON config key. Includes Behave BDD unit tests, Robot Framework integration tests, and ASV benchmarks. (#313)
  • Added container-aware tool execution and I/O forwarding via ContainerToolExecutor and PathMapper. Tools routed to execution_environment: container are executed inside a provisioned devcontainer with automatic host↔container path mapping, bounded output capture (50 MiB), structured error reporting, and container metadata on the ToolInvocation audit trail. Includes ContainerConfig, ContainerMetadata, ContainerExecutionError, and ContainerTimeoutError domain models, ToolRunner container routing integration, safe environment filtering, symlink/traversal protection, and sync_results_to_host for file-based result retrieval. Covered by Behave BDD scenarios, Robot Framework integration tests, ASV benchmarks, and docs/reference/execution_environment.md. (#515)
  • Implemented @tdd_expected_fail tag handling in Behave environment hooks. Added validate_tdd_tags() and should_invert_result() helper functions in features/environment.py. Scenarios tagged @tdd_expected_fail that fail have their result inverted to pass (expected failure); scenarios that unexpectedly pass are reported as failed with guidance to remove the tag. Tag validation enforces @tdd_bug + @tdd_bug_<N> prerequisites. Implemented via Scenario.run() monkey-patch in before_all. Includes 34 Behave BDD scenarios (19 tag-validation, 14 infrastructure, and 1 demo) and 12 Robot Framework integration test cases. (#627)
  • Wired AuditService.record() into domain services via EventBus auto-dispatch. Created AuditEventSubscriber that subscribes to 9 security-relevant event types (plan_applied, plan_cancelled, resource_modified, correction_applied, config_changed, entity_deleted, session_created, auth_success, auth_failure) and persists them via AuditService.record() with secret masking applied to all audit log details (always show_secrets=False). Subscriber enriches audit entries with session_id and correlation_id from the domain event for traceability. Wired PlanLifecycleService to emit PLAN_APPLIED and PLAN_CANCELLED events with all project names in event details. Added 5 new EventType enum members. Registered subscriber as eagerly-initialized singleton in DI container. AuditService now accepts an explicit database_url parameter so it shares the same database as the rest of the application. All EventBus.emit() call sites are wrapped in try/except guards with structured logging, and ReactiveEventBus isolates per-handler failures so one failing subscriber cannot block others. server connect now emits per-setting CONFIG_CHANGED audit events via set_value(). SessionService.delete() emits ENTITY_DELETED. Exception messages in the DI container bootstrap are redacted before logging. CorrectionService is registered as a singleton in the DI container. Includes 23 Behave BDD scenarios, 5 Robot Framework integration tests, and ASV benchmarks. (#581)

Added

  • Resource type single-inheritance via inherits field (ADR-042) (#513)
  • Inheritance chain resolution, field merging, and polymorphic type matching
  • ToolRegistry.find_tools_for_resource() for polymorphic tool binding
  • Polymorphic handler resolution with ancestor-type fallback
  • CLI: agents resource type list shows Inherits column; type show displays inheritance chain
  • Alembic migration m6_004_resource_type_inherits adds inherits column to resource_types
  • Fixed agents actor list raising a validation error on fresh projects. ActorRegistry._actor_name() built names via f"{provider}/{model}", which produced names with 2+ slashes when providers had models containing / (e.g. OpenRouter's anthropic/claude-sonnet-4-20250514). Now sanitises both provider and model names by replacing / with - and lowercasing to satisfy the spec pattern. Note: provider/model names are now lowercased; existing mixed-case built-in actors will be superseded by lowercased versions on the next ensure_built_in_actors() call. Includes Behave BDD regression scenarios, Robot Framework integration smoke tests, and ASV benchmarks. (#592)
  • Added TDD regression tests for agents session list DI container wiring error (bug #554). _get_session_service() calls container.db() but the Container class has no db provider, raising AttributeError. Includes 10 Behave BDD scenarios (@tdd_bug @tdd_bug_554 @tdd_expected_fail) covering empty list, empty-list format validation (JSON/YAML/plain), init-then-list lifecycle, post-create list, rich/JSON/plain/YAML output formats, and stderr error-path assertions. Robot Framework integration smoke tests and ASV service-layer benchmarks. Implements @tdd_expected_fail infrastructure (Behave after_scenario hook and Robot listener) and migrates 18 existing TDD scenarios from @tdd @bugNNN to @tdd_bug @tdd_bug_NNN convention. (#554)
  • Added TDD regression tests for agents session create DI container wiring error (bug #570). _get_session_service() calls container.db() but the Container class has no db provider, raising AttributeError. Same root cause as #554. Includes 4 Behave BDD scenarios (@tdd_bug @tdd_bug_570 @tdd_expected_fail), Robot Framework integration smoke tests, and ASV service-layer benchmarks. Tests exercise the real DI path with _service = None and a file-based SQLite database. Also implements the @tdd_expected_fail inversion infrastructure: a Behave after_scenario hook in features/environment.py that flips pass/fail for @tdd_expected_fail scenarios, and a Robot Framework Listener API v3 plugin (robot/tdd_expected_fail_listener.py) with identical semantics. Migrates 18 existing TDD scenarios from the old @tdd @bugNNN convention to standardised @tdd_bug @tdd_bug_NNN tags. (#570)
  • Fixed intermittent race condition in M4 validation integration tests when running under pabot. Root cause was three-pronged: shared SQLite DB URL, shared CLEVERAGENTS_HOME directory, and singleton leaks in chained CLI helper invocations. Introduced composable Setup Database Isolation keyword in common.resource, per-suite temp directories, and centralised reset_global_state() in robot/helpers_common.py. Added timeout=30s to all Run Process calls in m4_e2e_verification.robot. (#563)
  • Fixed agents project show not finding a project immediately after creation. Extended the session.commit() fix from #589 to also cover update() and delete() in NamespacedProjectRepository, and updated the class docstring to reflect that all mutating methods now commit within their own session. Includes 3 Behave BDD regression scenarios, Robot Framework integration smoke tests, and ASV benchmarks. (#590)
  • Fixed agents project create not persisting projects to the database. NamespacedProjectRepository.create() called session.flush() but never session.commit(), so projects were invisible to subsequent agents project list calls. Added session.commit() and a finally: session.close() guard. Includes 4 Behave BDD regression scenarios, Robot Framework integration smoke tests, and ASV benchmarks. (#589)
  • Added TDD-style Behave BDD tests for the built-in git-checkout resource type bootstrap. Three scenarios: one failing TDD test reproducing bug #524 (no bootstrap called during init), and two regression tests verifying bootstrap_builtin_types() seeds correct data and agents resource add git-checkout succeeds. Includes Robot Framework regression tests. (Drive-by: corrected bug reference from #523 to #524.) (#553)
  • Added TDD-style Behave BDD tests for the built-in fs-directory resource type bootstrap. Three scenarios: one failing TDD test reproducing bug #524 (no bootstrap called during init), and two regression tests verifying bootstrap_builtin_types() seeds correct data and agents resource add fs-directory succeeds. Includes Robot Framework regression tests. (#537)
  • Added TDD-style failing Behave BDD tests for the missing agents init --yes flag. Five scenarios: four TDD-failing tests (exit code, prompt suppression, -y alias, output summary) and one regression guard for interactive mode. Includes Robot Framework smoke tests and ASV benchmarks. Tests are intentionally failing until the bug fix for #522 is applied. (#536)
  • Added Temporal Data Model (Revision-Aware RDF) with 3 storage tiers for the ACMS. Temporal metadata fields (valid_from, valid_until, is_current, is_revision_of) on UKO InformationUnit nodes enable revision chain tracking: when code changes, old nodes are marked historical and new revision nodes are created with back-links. Three storage tiers (hot/warm/cold) filter nodes by temporal scope (current/recent/all) with configurable retention (warm_retention_hours default 24h, cold_retention_days default 90d). Includes TemporalMetadata, TemporalNode, RevisionChain, TierQueryResult, TierRetentionConfig frozen domain models, TemporalBackend protocol, InMemoryTemporalBackend stub, TemporalService with structlog and DI, BackendSet.temporal typing upgrade from object | None to TemporalBackend | None. 99 Behave scenarios, 8 Robot Framework tests, ASV benchmarks, and reference documentation. (#577)
  • Implemented UKO Layer 1 Domain Ontologies (uko-doc:, uko-data:, uko-infra:) in the OWL/Turtle ontology file (docs/ontology/uko.ttl). Added 17 uko-doc: classes (Document, Section, Paragraph, Citation, etc.), 13 uko-data: classes (Table, Column, ForeignKey, View, etc.), and 7 uko-infra: classes (Service, Endpoint, Port, etc.) with all spec-mandated properties and relationships. Updated all four DetailLevelMap presets (code_detail_map, docs_detail_map, database_detail_map, infra_detail_map) to be spec-complete with every named level. Added OntologyRegistry with domain lookup, Layer 1 listing, DetailLevelMap inheritance chain building, and Turtle syntax validation. Includes 31 Behave BDD scenarios and 6 Robot Framework integration tests. (#574)
  • Added PostgreSQLAnalyzer and DockerComposeAnalyzer domain-specific analyzers (Phase 2 of issue #588). PostgreSQLAnalyzer parses DDL content via regex and extracts uko-data:Table, uko-data:Column, uko-data:ForeignKey, uko-data:View, and uko-data:Schema triples with column metadata (data type, nullability, primary key). DockerComposeAnalyzer parses Docker Compose YAML via yaml.safe_load and extracts uko-infra:DeploymentUnit, uko-infra:Service, uko-infra:Port, uko-infra:EnvironmentVariable, and uko-infra:connectsTo triples. Both satisfy AnalyzerProtocol and register in AnalyzerRegistry by file extension. Includes 34 Behave BDD scenarios covering all four analyzers (protocol conformance, registry operations, triple extraction, error handling, cross-analyzer URI scheme and confidence checks), 6 Robot Framework integration smoke tests, and updated __init__.py exports. (#588)
  • Added TDD-style Behave BDD tests for the built-in git-checkout resource type bootstrap. Three scenarios: one failing TDD test reproducing bug #524 (no bootstrap called during init), and two regression tests verifying bootstrap_builtin_types() seeds correct data and agents resource add git-checkout succeeds. Includes Robot Framework regression tests. (#553)
  • Added UKO Indexer for real-time index synchronization. UKOIndexer orchestrates analysis of resources into UKO triples via pluggable AnalyzerRegistry and simultaneously indexes into text, vector, and graph backends. Provenance metadata (ProvenanceMetadata, ProvenancedTriple) is attached to every triple, tracking source resource, file path, and temporal validity. Write-side index backend protocols (TextIndexBackend, VectorIndexBackend, GraphIndexBackend) are distinct from the existing read-side query protocols. Graceful degradation: if text or vector backends are None, the corresponding indexing step is silently skipped. Index lifecycle: index_resource (add), remove_resource (cleanup), reindex_resource (change). ContentReader protocol decouples the indexer from filesystem I/O. IndexLifecycleHook provides callbacks for indexing events. In-memory stub implementations for all three backends. ResourceFileWatcher monitors filesystem paths via watchdog and triggers re-indexing callbacks on file changes with configurable debouncing and optional RESOURCE_MODIFIED EventBus emission. Includes 166 Behave BDD scenarios, 9 Robot Framework integration tests, ASV benchmarks, and reference documentation. (#578)
  • Added general-purpose domain event system under cleveragents.infrastructure.events. EventType StrEnum defines 38 typed event identifiers across 9 domains (plan lifecycle, decision, invariant, actor, tool, resource, sandbox, context, validation, session, budget). DomainEvent is a frozen Pydantic model with event_type, auto-UTC timestamp, auto-ULID correlation_id, plan_id, root_plan_id, session_id, actor_name, project_name, and details fields. EventBus is a @runtime_checkable Protocol with emit() and subscribe() methods. ReactiveEventBus is an RxPY Subject-backed in-process bus that dispatches synchronously to type-filtered handlers and exposes a raw rx.Observable stream for advanced operators. LoggingEventBus is a structlog-based bus for audit logging that requires no RxPY dependency. DecisionService and PlanLifecycleService accept an optional event_bus parameter (backward-compatible) and emit DECISION_CREATED, PLAN_CREATED, and PLAN_PHASE_CHANGED on significant state changes. ReactiveEventBus is registered as a Singleton in the DI container and wired into both services automatically. Includes Behave BDD unit tests (27 scenarios, 75 steps, 100% coverage on all new source files), Robot Framework smoke tests (9 cases), ASV performance benchmarks (5 suites), and reference documentation (docs/reference/event_bus.md). (#473)
  • Validated M4 acceptance criteria for v3.3.0 milestone closure. All M4 E2E verification tests and correction/subplan smoke tests pass against the final v3.3.0 implementation. Added CLI-exercising integration tests for plan use, plan execute, and plan tree commands to verify the milestone success criteria through actual Typer CLI invocations. Split 1074-line helper into six focused modules (_common, _domain, _merge, _cli, _cli_errors, dispatcher) under the 500-line limit. Added CLI error-path tests for read-only plan execute, unavailable action, missing changeset, and empty decision tree. Extracted _make_subplan_status factory, _assert_exit_code and _assert_mock_called_once* wrappers, frozen timestamp constant, and shutil.which git pre-check. Removed tautological domain assertions in plan_tree and parallel_max. Fixed CONTRIBUTORS.md alphabetical ordering. (#495)
  • Added minimal LSP server stub with agents lsp serve CLI command supporting the initialize, shutdown, and exit lifecycle handshake over JSON-RPC stdin/stdout transport with Content-Length header framing. Unsupported methods return MethodNotFound (-32601); requests before initialize return ServerNotInitialized (-32002); requests after shutdown return InvalidRequest (-32600). Transport hardening includes 10 MB max content-length, 32 max header lines, graceful recovery from malformed messages, and recursion-depth protection. LspServer stores an A2aLocalFacade for future server-mode wiring. --log-level flag controls logging verbosity. Includes 48 Behave BDD scenarios, Robot Framework smoke tests, ASV startup latency benchmarks, and docs/reference/lsp_stub.md. (#203)
  • Validated M3 acceptance criteria for v3.2.0 milestone closure. All 10 E2E verification tests pass against the final implementation, exercising real CLI command paths (plan use, plan execute, plan tree, plan explain, project-scoped invariant add/list, dry-run and live plan correct), database-backed persistence, context snapshots, and invariant enforcement during strategize. Added acceptance criteria tags and milestone documentation to the robot suite. (#494)
  • Added scoped backend view filtering for project-resource isolation in ACMS. ResourceScope holds the resolved set of resource ULIDs and project names visible to a plan (immutable, with include_paths/exclude_paths glob filtering via PurePath.full_match()). ScopedBackendView wraps text/vector/graph backends to auto-inject the scope parameter into every query, and filters TieredFragment visibility by project name and resource ID. ScopedBackendSet bundles scoped views for all three backend types. ResourceAliasResolver translates user-facing aliases to canonical resource ULIDs with uniqueness validation. resolve_resource_scope() builds a ResourceScope from projects with allowlist/denylist filtering. validate_project_scope() and validate_resource_scope() guard against out-of-scope access. Three enforcement hooks added to ContextTierService: get_scoped_by_resource, validate_fragment_scope, store_with_scope_check. Includes 74 Behave BDD scenarios (with full coverage-gap tests), 8 Robot Framework integration tests, ASV benchmarks, and reference documentation. (#193)
  • Added builtin/plan-subplan tool for strategy actors to emit SUBPLAN_SPAWN or SUBPLAN_PARALLEL_SPAWN decisions. Validates payload via SubplanPayload (Pydantic), applies defaults (merge strategy, max_parallel, dependencies), generates rationale text, and optionally persists the Decision via an injected DecisionService. Includes register_subplan_tool, make_plan_subplan_spec factory, Behave unit tests, Robot Framework integration smoke tests, ASV benchmarks, and an actor YAML example. (#198)
  • Extended CorrectionService._compute_affected_subtree() to BFS over both the structural decision tree (parent-child) and the influence DAG (decision_dependencies edges). Added cycle detection guard via visited set. Updated DecisionService.record_decision() to accept dependency_decision_ids parameter for recording influence relationships during decision creation. Added DecisionService.get_influence_edges() to retrieve influence DAG as adjacency list. All public methods on CorrectionService (analyze_impact, execute_revert, execute_correction, generate_dry_run_report) now accept optional influence_edges parameter. Includes Behave BDD scenarios, Robot Framework integration tests, and ASV benchmarks. (#542)
  • Added Semantic Escalation system with AutonomyController class implementing should_proceed_automatically() that computes confidence scores from weighted factors (past_success_rate, codebase_familiarity, risk_assessment, invariant_complexity) and compares them against automation profile thresholds. Includes EscalationDecision, ConfidenceFactors, OperationContext, and HistoricalOutcome domain models. Historical success tracking records outcomes for future confidence computation. Integrates with all 8 built-in automation profiles. DI-wired as singleton autonomy_controller. Includes 48 Behave BDD scenarios, 10 Robot Framework integration tests, and ASV benchmarks. (#546)
  • Added context strategy registry with ContextStrategy protocol, StrategyCapabilities, BackendSet, PlanContext, StrategyConfig, ContextStrategyResult, and StrategyRegistryEntry domain models. Six built-in stub strategies (simple-keyword, semantic-embedding, breadth-depth-navigator, arce, temporal-archaeology, plan-decision-context) with spec-mandated quality scores and backend requirements. StrategyRegistry supports config-driven registration, per-strategy timeout/max-fragment limits, per-project enable/disable overrides, plugin discovery from "module:ClassName" strings, and validation that strategies declare supported resource types. (#191)
  • Fixed context inspect to display project-scoped tier fragment counts instead of global counts. Added ContextTierService.get_scoped_metrics() which returns fragment population counts filtered to the target project while keeping hit/miss counters as global service metrics. (#499)
  • Fixed context simulate --focus to filter fragments by the specified focus URIs during dry-run assembly. Previously, focus URIs were passed to ContextRequest but not applied to fragment selection, making --focus a no-op. (#499)
  • Wired project context CLI stubs (inspect, simulate, set, show) to live ACMS pipeline services. context inspect queries ContextTierService for tier metrics and per-project fragments with optional filtering by strategy, focus area, breadth, and depth. context simulate performs dry-run context assembly using CRP models with configurable token budget and assembly strategies. context set gains 12 ACMS pipeline options (hot_max_tokens, warm_max_decisions, cold_max_decisions, summary_max_tokens, temporal_scope, auto_refresh, focus_area, breadth, depth, assembly_strategy, retrieval_strategy, summary_strategy). context show displays ACMS pipeline configuration alongside context policy. Includes 28 Behave BDD scenarios for wiring coverage, updated Robot Framework integration tests, and reference documentation. (#499)
  • Added async command execution infrastructure allowing plan phases (Execute, Apply) to run as background jobs processed by a thread pool of workers. AsyncJob Pydantic v2 domain model with ULID primary key, status state machine (queued -> running -> succeeded/failed/cancelled), and payload schema versioning. AsyncWorker service with ThreadPoolExecutor-backed concurrent execution, race-safe cancellation contract, stuck job detection, and job cleanup. InMemoryJobStore with atomic snapshot_counts() and single-pass remove_expired(). Plan lifecycle service wired to enqueue jobs when async.enabled is True. Error messages redacted via shared/redaction.py before persisting to the audit trail. Configurable via async.enabled, async.max_workers, async.poll_interval, async.job_timeout, async.job_ttl. Includes AsyncJobModel SQLAlchemy model, Alembic migration, Behave BDD scenarios, Robot Framework integration tests, ASV benchmarks, and docs/reference/async_architecture.md. (#312)
  • Added hot/warm/cold context tiers with ContextTier, ActorRole, TieredFragment, TierBudget, ActorContextView, TierMetrics, and ScopedBackendView models. ContextTierService provides store/get, promotion/demotion with cold-tier summarisation hook, LRU eviction, per-actor filtered views (strategist/executor/reviewer), and project-scoped isolation. Settings: context_max_tokens_hot, context_max_decisions_warm, context_max_decisions_cold. DI-wired as singleton context_tier_service. Includes Behave BDD scenarios, Robot Framework integration tests, ASV benchmarks, and docs/reference/context_tiers.md. (#208)
  • Added ExecutionEnvironment enum (host, container) and execution environment routing with priority chain (tool > plan > project > default). Includes ExecutionEnvironmentResolver service, --execution-environment CLI flags on agents plan use and agents plan execute, project-level context config support via agents project context set --execution-environment, tool runner wiring with container availability validation, and clear error when container is selected but no container resource is linked. Covered by Behave BDD scenarios, Robot Framework smoke tests, and ASV benchmarks. (#512)
  • Added multi-project subplan support with MultiProjectMetadata, ProjectScope, ChangeSetSummary, CrossProjectDependency, and ProjectScopeResolver domain models. MultiProjectService provides scope initialization, context resolution, per-project changeset recording, and cross-project constraint validation. Plan model extended with multi_project_metadata field, is_multi_project property, and get_project_scope() method. CLI plan status shows per-project changeset summaries for multi-project plans. Includes Behave BDD scenarios, Robot Framework smoke tests, ASV benchmarks, and reference documentation. (#199)
  • Added large-project hierarchical decomposition with 4+ levels and bounded context per subplan. Includes clustering heuristics (directory, language, size), bounded dependency closure with memoization for 10K+ files, DAG execution ordering with cycle detection, and DecisionService integration for strategy_choice + subplan_spawn recording. Configurable via planner_max_depth, planner_max_files_per_subplan, planner_max_tokens_per_subplan, planner_min_files_per_subplan settings. (#205)
  • Added LLMTrace Pydantic v2 domain model and llm_traces database table with LLMTraceRepository for persisting LLM call telemetry (tokens, cost, latency, tool calls, context hash, streaming flag, retry count, error). Defined 14 OperationalMetricKey values with MetricEntry / MetricCollector for plan-level metrics. TraceService provides recording, querying, metric computation, and optional LangSmith forwarding when LANGCHAIN_TRACING_V2=true. (#500)
  • Added SafetyProfile domain model with configurable safety constraints (allowed skill categories, sandbox/checkpoint requirements, human-approval flag, cost/retry limits) and integrated it into the Action model via from_config/as_cli_dict. Persistence backed by safety_profile_json column on LifecycleActionModel with Alembic migration c4_001_safety_profile_column. Includes resolve_safety_profile() stub that raises NotImplementedError in local mode (real enforcement deferred to server mode). Covered by 26 Behave BDD scenarios, 6 Robot Framework smoke tests, 5 ASV benchmark suites, and docs/reference/safety_profile.md reference documentation. (#332)
  • Added devcontainer-instance, devcontainer-file, and container-instance built-in resource types with DevcontainerHandler and auto-discovery logic that scans for .devcontainer/ directories when git-checkout or fs-directory resources are linked. Includes CLI support, Behave/Robot/ASV tests, and reference documentation. (#511)
  • Added full lifecycle management for devcontainer-instance resources: lazy activation on first tool target via DevcontainerHandler.resolve(), health checking with periodic liveness probes, manual agents resource stop/agents resource rebuild CLI commands (rebuild passes --reset-container to force container recreation), and automatic session-scoped cleanup on session close or plan completion. Lifecycle state tracked via ContainerLifecycleTracker with six states (detected/building/running/stopping/ stopped/failed) and validated transitions. Includes Behave BDD scenarios, Robot Framework integration tests, ASV benchmarks, and reference documentation. (#514)
  • Added skeleton compressor service (SkeletonCompressorService) for ACMS context inheritance. Compresses parent plan context fragments by skeleton_ratio (0.01.0) for propagation to child plans. Persists SkeletonMetadata (ratio, token counts, source decision IDs) on the plan model for auditability. Includes stable fragment ordering, ratio validation with default handling, and compression summary. (#194)
  • Wired A2A local facade handlers to live application services. session.create/close delegate to SessionService; plan.create/execute/status/diff/apply delegate to PlanLifecycleService; registry.list_tools and registry.list_resources delegate to ToolRegistry and ResourceRegistryService; event.subscribe delegates to A2aEventQueue. context.get returns a stub pending ACMS pipeline. Added domain-to-A2A error code mapping (NOT_FOUND, VALIDATION_ERROR, INVALID_STATE, PLAN_ERROR, etc.) via map_domain_error(). (#501)
  • Added plan explain and plan tree CLI commands for decision tree inspection with json/yaml/table/rich output formats, and flags for superseded decisions, context snapshots, and reasoning details. (#174)
  • Replaced behave-parallel subprocess-per-feature execution model (342 Python interpreter startups) with in-process execution via behave's Runner API. Sequential mode runs all features in a single Runner.run() call; parallel mode uses multiprocessing.Pool with fork for COW sharing of heavy modules. Coverage pipeline simplified to a single slipcover invocation wrapping the entire process. Unit tests: 24m21s -> 2m05s (91% reduction); coverage report: 75m20s -> 3m00s (96% reduction). (#481)
  • Optimized 20 medium-slow BDD features (10-100s tier). Capped time.sleep and asyncio.sleep globally at 10ms in before_all to eliminate retry/backoff waits; originals saved as time._original_sleep / asyncio._original_sleep for timing-sensitive tests. Replaced subprocess.run CLI invocations with CliRunner in coverage step files. Switched persistence features to in-memory SQLite by default. Total tier runtime reduced from 565s to 21s (96%). (#480)
  • Optimized the 8 slowest BDD feature files (100-248s each, 64% of total runtime). Added @mock_only tag support to skip unnecessary DB setup, extracted shared service-setup helpers in services_coverage_steps.py (~200 lines of duplicated boilerplate removed), and introduced lightweight in-memory plan service for actor-resolution tests. (#479)
  • Added pre-migrated SQLite template database via scripts/create_template_db.py to eliminate repeated Alembic migrations per BDD scenario. Nox sessions propagate the template via CLEVERAGENTS_TEMPLATE_DB env var; features/environment.py monkey-patches MigrationRunner.init_or_upgrade to copy the template for fresh scenario temp DBs, falling through to real migrations for :memory:, existing files, and migration-runner unit tests. (#483)
  • Replaced coverage.py (sys.settrace) with slipcover (bytecode instrumentation) for faster coverage collection. Each behave-parallel worker now produces per-feature JSON coverage files; slipcover --merge combines them. CI workflow JSON key lookups handle both slipcover and coverage.py output formats. Documentation updated to reflect slipcover as the coverage tool. (#482)
  • Added checkpointing and rollback with CheckpointService for creating, listing, pruning, and deleting sandbox snapshots, and restoring sandbox state via plan rollback <plan_id> <checkpoint_id> CLI command. Checkpoint domain models (Checkpoint, CheckpointMetadata, CheckpointRetentionPolicy, RollbackResult) store sandbox refs, decision alignment, checkpoint type (pre_write, post_step, manual), filesystem path, size, and structured audit metadata (reason, source tool, phase). Retention policy auto-prunes oldest interior checkpoints when exceeding max_checkpoints (default 50), preserving the first and most recent. Guards reject rollback when plan is applied or sandbox is missing. CorrectionService accepts an optional CheckpointService integration point for future revert delegation. CheckpointRepository and CheckpointModel back persistence via the session-factory pattern (ADR-007), with UnitOfWorkContext.checkpoints for cross-repository atomicity. Alembic migration m6_001_checkpoint_metadata adds the checkpoint_metadata table. Includes Behave BDD scenarios (33 scenarios, 129 steps), Robot Framework integration tests (11 test cases), ASV benchmarks, and docs/reference/checkpointing.md. (#206)
  • Added semantic validation service with AST-based rules for syntax errors, missing imports, broken references, duplicate imports, API misuse, and missing symbols. Includes rule registry, file-hash LRU cache, severity mapping, and ValidationPipeline integration. (#448)
  • Added comprehensive M6 autonomy acceptance test suite covering A2A local facade dispatch (session/plan/registry/context/event operations), event queue pub/sub with local callbacks and close semantics, HTTP transport stub rejection, version negotiation, automation profile built-ins (8 profiles), custom profile creation/validation/YAML loading, guard enforcement (denylist, allowlist, call-limit, cost-budget, write-approval, apply-approval), and profile service 4-level resolution precedence. Includes Behave BDD scenarios (52), Robot Framework integration tests (11), ASV performance benchmarks (5 suites), JSON fixtures, and documentation update. (#211)
  • Added MCP refresh hooks to wire notifications/tools/list_changed events from MCP servers to SkillRegistry. Introduced SkillRegistry.refresh(name) and refresh_all() to recompute flattened tool sets on demand. Added MCPRefreshHook with configurable debounce window (default 0.5 s) to coalesce rapid notification bursts into a single refresh call. Refresh skips tool-ref validation when no ToolRegistry is configured and emits a single WARNING with recovery steps. Results are summarised as an immutable SkillRefreshResult (refreshed / failed / skipped counts) for CLI and log output. Includes Behave unit tests (19 scenarios), Robot Framework integration tests (10 tests), ASV benchmarks, and docs/reference/skill_refresh.md. (#168)
  • Added agents skill refresh <name>|--all command to recompute tool flattening and sync MCP-backed skills. Enhanced skill list, skill show, and skill tools outputs with capability summary fields, tool counts, and description columns. Added --format json/yaml schemas for refresh output. Updated CLI reference documentation with refresh examples and caching behavior. (#167)
  • Added UKO Layer 0-3 ontology scaffolding (RDF/TTL) aligned with specification Section 14. Layer 0 (uko:) defines InformationUnit, Container, Atom, Annotation, Boundary plus contains/references/dependsOn relationships, content properties (hasRendering, renderingDepth, hasFullContent), provenance properties (sourceResource, sourcePath, sourceRange), and temporal properties (validFrom, validUntil, isCurrent, isRevisionOf). Layer 1 (uko-code:) defines Module, Callable, TypeDefinition, TestCase, Import plus hasReturnType/hasParameters/testsCallable. Layer 2 (uko-oo:) defines Class, Interface, Method, Attribute plus inheritsFrom/implements with rdfs:subPropertyOf. Layer 3 is reserved for DetailLevelMap insertions. Loader supports semantic domain prefixes, hyphenated prefix names, full-URI layer detection, multi-parent rdfs:subClassOf (DAG traversal via BFS), rdfs:domain/rdfs:range/rdfs:subPropertyOf resolution, and non-existent parent validation. (#189)
  • Added ACMS v1 context assembly pipeline with UKO and CRP integration, three fusion strategies (relevance, recency, tiered), budget-constrained assembly, and extensible strategy registration. (#188)
  • Added AgentSkillSpec loader that parses SKILL.md frontmatter and progressive disclosure sections into structured SkillStep objects with stable 1-based ordering. Supports namespaced naming (namespace/short_name), optional steps, version, compatibility, metadata, and allowed-tools frontmatter fields. Explicit validation raises actionable errors for missing name/description and invalid namespace format. Agent Skills are mapped to AgentSkillToolDescriptor with source="agent_skill" and read-only defaults. Support directories (scripts/, references/, assets/) are discovered automatically and exposed as read-only AgentSkillResourceSlot bindings. Includes docs/reference/agent_skills.md, Behave unit tests, Robot Framework integration tests, and ASV benchmarks. (#160)
  • Added MCP adapter runtime (MCPToolAdapter) to connect to external MCP servers via stdio, SSE, and streamable-http transports. Supports full connection lifecycle (connect with timeout, reconnect, disconnect), tool discovery, input-validated invocation, and bulk registration into ToolRegistry with source="mcp" and checkpointable=False. Includes Behave unit tests, Robot integration test, ASV benchmarks, and docs/reference/mcp_adapter.md.

fix(permissions): address code-review findings for permission system (#448)

  • Added input validation to check_permission() and get_role_bindings(): empty or whitespace-only principal and scope_id arguments now raise ValueError after stripping, preventing silent lookup misses.
  • Aligned module docstring and reference docs to clarify that the enforce_permission decorator is available but not yet wired into CLI or service call sites — integration is deferred to a future pass.
  • Added permissions.md to the docs nav in gen_ref_pages.py.
  • Added Behave BDD scenarios covering empty, whitespace-only, and leading/trailing-whitespace inputs for both check_permission() and get_role_bindings().

feat(actor): extend hierarchical actor YAML schema and loader

  • Extended actor YAML schema with hierarchical graph support: per-node LSP bindings (lsp_binding), tool-source references (tool_sources), and subgraph actor_ref.
  • Added graph reachability validation — all nodes must be reachable from entry_node via edges or conditional routing targets.
  • Improved loader error reporting with YAML line/column positions and Pydantic field-path hints.
  • Added docs/reference/actor_config.md — practical configuration reference with hierarchical examples and error cases.
  • Fixed examples/actors/graph_workflow.yaml to use actor_ref instead of deprecated actor_path.
  • Added Robot smoke test for loading hierarchical actor YAML via ActorLoader.discover() (#157).
  • Added decision persistence layer with DecisionRepository, DecisionModel, Alembic migration, tree queries (BFS traversal, path-to-root), superseded lookup, and ordered decision path retrieval. Includes Behave BDD scenarios, Robot Framework integration tests, and ASV benchmarks. (#171)
  • Added token/cost tracking, budget enforcement (per-plan and per-day), provider fallback selection with capability filtering, and cost metadata for plan execution. New config keys budget_per_plan, budget_per_day, and fallback_providers control spending limits and provider ordering. Budget warnings are emitted at 90% usage, and requests are blocked at 100%. Per-provider cost table includes default token cost estimates for offline reporting. Budget exhaustion events are persisted in plan metadata for auditability. (#324)
  • Added comprehensive Behave, Robot Framework, and ASV test coverage for CLI extension features including automation profile resolution, invariant ordering, actor override error cases, and output format snapshot assertions.
  • Added comprehensive E2E test suite for M2 (Actor Graphs + Tool Sources) epic covering actor YAML loading, skill registry, tool lifecycle, and MCP stub tool discovery with Behave BDD scenarios, Robot Framework integration tests, and ASV performance benchmarks.
  • Added plan-level and project-level advisory locking with configurable timeouts, re-entrant acquisition, conflict detection, lock renewal, graceful shutdown release, startup cleanup of expired locks, and diagnostics check for stale lock reporting. (#327)
  • Added core plan apply service with diff review output (plain, rich, JSON, YAML), artifact summaries, apply summary persistence, merge-failure handling with sandbox rollback, and empty ChangeSet guard. (#155)
  • Added validation pipeline with rule-based checks, severity levels (required vs informational), result aggregation, deterministic execution ordering, per-validation timeouts, and gate enforcement that blocks apply when required validations fail. (#175)
  • Added validation-gated apply pipeline that blocks the Apply phase when required Execute-phase validations have not passed, transitions plans to constrained state with actionable CLI hints, and runs validation attachments during apply. (#176)
  • Added diff review artifact model with inline comments, approval status, per-resource grouping, before/after content hashes, and plan apply service integration for plan diff and plan status outputs. (#303)
  • Added definition-of-done gating that evaluates DoD criteria before apply, blocks phase transitions when required conditions are unmet, and stores pass/fail reasoning in the plan validation summary. (#178)
  • Added error recovery patterns (retry, fallback, skip, abort) with structured recovery hints in CLI error output, plan executor integration, and error recovery service for capturing error category, recovery action, and retry history. (#186)
  • Hardened template rendering by replacing unsafe Jinja2 usage with a sandboxed renderer that denies attribute access, function calls, and filters, allowing only {var} substitution from a fixed allowlist with max template length and max output size enforcement. (#319)
  • Enforced explicit exception handling by introducing a CleverAgentsError base class with structured error types for configuration, provider, and file I/O failures, error code mapping, bare-except prohibition, and secret redaction in error details. (#320)
  • Added 32 BDD scenarios to boost unit test coverage from 97.0% to 97.2%.
  • Added Behave BDD scenarios for six under-tested modules (container, correction service, plan lifecycle service, plan CLI, skill CLI, database models) to exercise uncovered lines, exception-handling paths, and partial branches. (#446)
  • Fixed failing Robot Framework integration tests related to security secrets handling.
  • Fixed style check violations across the codebase.
  • Fixed failing unit tests.
  • Added changeset persistence and diff artifact storage for tracking multi-file changes across plan execution phases. (#163)
  • Added AsyncResourceTracker for unified async resource lifecycle with timeout-bounded cleanup, leak detection via finalizer, and async context manager support.
  • Enhanced LangGraphBridge with graceful task cancellation that awaits in-flight tasks.
  • Added StateManager.close() and A2aEventQueue.close() for proper resource disposal.
  • Tightened read-only enforcement: write-capable tools are now blocked on read-only plans regardless of the tool's own read_only flag.
  • Added ReadOnlyViolationError to ChangeSetCapture to prevent write artifacts on read-only plans.
  • Added CLI fail-fast guards on plan execute and plan apply for read-only plans.
  • Added DecisionService with record/list/tree helpers and SnapshotStore for hash-based deduplication of context snapshots during plan execution.
  • Expanded CONTRIBUTING.md with detailed guidance on the issue creation process, label system, ticket lifecycle, pull request requirements, and review/merge process.
  • Added commit scope, quality, and message format guidelines to CONTRIBUTING.md.
  • Migrated implementation timeline from the monolithic implementation plan to docs/timeline.md.
  • Migrated implementation notes to docs/implementation-notes.md.
  • Relocated remaining implementation plan content to the specification and CONTRIBUTING.md, and removed implementation_plan.md from the repository.
  • Updated CONTRIBUTING.md to include project-specific conventions for tooling, testing, type checking, and code style.

v1.0.0

First release.