4232907ab9
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 16s
CI / quality (pull_request) Successful in 18s
CI / build (pull_request) Successful in 23s
CI / typecheck (pull_request) Successful in 34s
CI / security (pull_request) Successful in 39s
CI / unit_tests (pull_request) Successful in 3m17s
CI / docker (pull_request) Successful in 40s
CI / integration_tests (pull_request) Successful in 4m3s
CI / coverage (pull_request) Successful in 4m9s
CI / lint (push) Successful in 12s
CI / quality (push) Successful in 16s
CI / build (push) Successful in 15s
CI / security (push) Successful in 29s
CI / typecheck (push) Successful in 33s
CI / benchmark-regression (push) Has been skipped
CI / unit_tests (push) Successful in 2m23s
CI / integration_tests (push) Successful in 2m48s
CI / docker (push) Successful in 38s
CI / coverage (push) Successful in 4m16s
CI / benchmark-publish (push) Successful in 16m55s
CI / benchmark-regression (pull_request) Successful in 30m14s
Add hierarchical decomposition with 4+ levels and bounded context per subplan. Implement decomposition heuristics (max_files_per_subplan, max_tokens_per_subplan, language/dir clustering). Add dependency closure computation for large graphs and DAG execution ordering. Add bounded dependency closure with cutoff thresholds and memoization for 10K+ files. Record decomposition decisions in DecisionService (strategy_choice + subplan_spawn entries). New modules: - decomposition_models.py: DecompositionConfig, DecompositionNode, DecompositionResult, DependencyEdge, DependencyGraph - decomposition_clustering.py: ClusteringStrategy with directory, language, and size clustering plus deterministic sort - decomposition_graph.py: DependencyClosureComputer with bounded closure, topological sort, cycle detection, and memoization - decomposition_service.py: DecompositionService orchestrating hierarchy building and decision recording Settings: planner_max_depth, planner_max_files_per_subplan, planner_max_tokens_per_subplan, planner_min_files_per_subplan Closes #205
18 KiB
18 KiB
Changelog
Unreleased
- Added hot/warm/cold context tiers with
ContextTier,ActorRole,TieredFragment,TierBudget,ActorContextView,TierMetrics, andScopedBackendViewmodels.ContextTierServiceprovides 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 singletoncontext_tier_service. Includes Behave BDD scenarios, Robot Framework integration tests, ASV benchmarks, anddocs/reference/context_tiers.md. (#208) - Added
ExecutionEnvironmentenum (host,container) and execution environment routing with priority chain (tool > plan > project > default). IncludesExecutionEnvironmentResolverservice,--execution-environmentCLI flags onagents plan useandagents plan execute, project-level context config support viaagents 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, andProjectScopeResolverdomain models.MultiProjectServiceprovides scope initialization, context resolution, per-project changeset recording, and cross-project constraint validation. Plan model extended withmulti_project_metadatafield,is_multi_projectproperty, andget_project_scope()method. CLIplan statusshows 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_subplansettings. (#205) - Added
SafetyProfiledomain model with configurable safety constraints (allowed skill categories, sandbox/checkpoint requirements, human-approval flag, cost/retry limits) and integrated it into theActionmodel viafrom_config/as_cli_dict. Persistence backed bysafety_profile_jsoncolumn onLifecycleActionModelwith Alembic migrationc4_001_safety_profile_column. Includesresolve_safety_profile()stub that raisesNotImplementedErrorin local mode (real enforcement deferred to server mode). Covered by 26 Behave BDD scenarios, 6 Robot Framework smoke tests, 5 ASV benchmark suites, anddocs/reference/safety_profile.mdreference documentation. (#332) - Added
devcontainer-instance,devcontainer-file, andcontainer-instancebuilt-in resource types withDevcontainerHandlerand auto-discovery logic that scans for.devcontainer/directories whengit-checkoutorfs-directoryresources are linked. Includes CLI support, Behave/Robot/ASV tests, and reference documentation. (#511) - Added skeleton compressor service (
SkeletonCompressorService) for ACMS context inheritance. Compresses parent plan context fragments byskeleton_ratio(0.0–1.0) for propagation to child plans. PersistsSkeletonMetadata(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 ACP local facade handlers to live application services.
session.create/closedelegate toSessionService;plan.create/execute/status/diff/applydelegate toPlanLifecycleService;registry.list_toolsandregistry.list_resourcesdelegate toToolRegistryandResourceRegistryService;event.subscribedelegates toAcpEventQueue.context.getreturns a stub pending ACMS pipeline. Added domain-to-ACP error code mapping (NOT_FOUND,VALIDATION_ERROR,INVALID_STATE,PLAN_ERROR, etc.) viamap_domain_error(). (#501) - Added
plan explainandplan treeCLI 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
RunnerAPI. Sequential mode runs all features in a singleRunner.run()call; parallel mode usesmultiprocessing.Poolwithforkfor 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.sleepandasyncio.sleepglobally at 10ms inbefore_allto eliminate retry/backoff waits; originals saved astime._original_sleep/asyncio._original_sleepfor timing-sensitive tests. Replacedsubprocess.runCLI invocations withCliRunnerin 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_onlytag support to skip unnecessary DB setup, extracted shared service-setup helpers inservices_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.pyto eliminate repeated Alembic migrations per BDD scenario. Nox sessions propagate the template viaCLEVERAGENTS_TEMPLATE_DBenv var;features/environment.pymonkey-patchesMigrationRunner.init_or_upgradeto 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
CheckpointServicefor creating, listing, pruning, and deleting sandbox snapshots, and restoring sandbox state viaplan 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 exceedingmax_checkpoints(default 50), preserving the first and most recent. Guards reject rollback when plan is applied or sandbox is missing.CorrectionServiceaccepts an optionalCheckpointServiceintegration point for future revert delegation.CheckpointRepositoryandCheckpointModelback persistence via the session-factory pattern (ADR-007), withUnitOfWorkContext.checkpointsfor cross-repository atomicity. Alembic migrationm6_001_checkpoint_metadataadds thecheckpoint_metadatatable. Includes Behave BDD scenarios (33 scenarios, 129 steps), Robot Framework integration tests (11 test cases), ASV benchmarks, anddocs/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 ACP 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_changedevents from MCP servers toSkillRegistry. IntroducedSkillRegistry.refresh(name)andrefresh_all()to recompute flattened tool sets on demand. AddedMCPRefreshHookwith configurable debounce window (default 0.5 s) to coalesce rapid notification bursts into a single refresh call. Refresh skips tool-ref validation when noToolRegistryis configured and emits a singleWARNINGwith recovery steps. Results are summarised as an immutableSkillRefreshResult(refreshed / failed / skipped counts) for CLI and log output. Includes Behave unit tests (19 scenarios), Robot Framework integration tests (10 tests), ASV benchmarks, anddocs/reference/skill_refresh.md. (#168) - Added
agents skill refresh <name>|--allcommand to recompute tool flattening and sync MCP-backed skills. Enhancedskill list,skill show, andskill toolsoutputs with capability summary fields, tool counts, and description columns. Added--format json/yamlschemas for refresh output. Updated CLI reference documentation with refresh examples and caching behavior. (#167) - Added
AgentSkillSpecloader that parses SKILL.md frontmatter and progressive disclosure sections into structuredSkillStepobjects with stable 1-based ordering. Supports namespaced naming (namespace/short_name), optionalsteps,version,compatibility,metadata, andallowed-toolsfrontmatter fields. Explicit validation raises actionable errors for missingname/descriptionand invalid namespace format. Agent Skills are mapped toAgentSkillToolDescriptorwithsource="agent_skill"and read-only defaults. Support directories (scripts/,references/,assets/) are discovered automatically and exposed as read-onlyAgentSkillResourceSlotbindings. Includesdocs/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 intoToolRegistrywithsource="mcp"andcheckpointable=False. Includes Behave unit tests, Robot integration test, ASV benchmarks, anddocs/reference/mcp_adapter.md.
fix(permissions): address code-review findings for permission system (#448)
- Added input validation to
check_permission()andget_role_bindings(): empty or whitespace-onlyprincipalandscope_idarguments now raiseValueErrorafter stripping, preventing silent lookup misses. - Aligned module docstring and reference docs to clarify that the
enforce_permissiondecorator is available but not yet wired into CLI or service call sites — integration is deferred to a future pass. - Added
permissions.mdto the docs nav ingen_ref_pages.py. - Added Behave BDD scenarios covering empty, whitespace-only, and
leading/trailing-whitespace inputs for both
check_permission()andget_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 subgraphactor_ref. - Added graph reachability validation — all nodes must be reachable from
entry_nodevia 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.yamlto useactor_refinstead of deprecatedactor_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, andfallback_providerscontrol 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 diffandplan statusoutputs. (#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
CleverAgentsErrorbase 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
AsyncResourceTrackerfor unified async resource lifecycle with timeout-bounded cleanup, leak detection via finalizer, and async context manager support. - Enhanced
LangGraphBridgewith graceful task cancellation that awaits in-flight tasks. - Added
StateManager.close()andAcpEventQueue.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_onlyflag. - Added
ReadOnlyViolationErrortoChangeSetCaptureto prevent write artifacts on read-only plans. - Added CLI fail-fast guards on
plan executeandplan applyfor read-only plans. - Added
DecisionServicewith record/list/tree helpers andSnapshotStorefor 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.mdfrom the repository. - Updated CONTRIBUTING.md to include project-specific conventions for tooling, testing, type checking, and code style.
v1.0.0
First release.