docs/developer-setup-guide
1928 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
2365f9a355 |
test(actor): add TDD failing tests for actor list empty validation error
Behave BDD scenarios (3) tagged @tdd_bug @tdd_bug_592 @tdd_expected_fail exercise the real ActorRegistry._actor_name() code path with a provider whose default model contains '/' separators. The tests assert correct behaviour (exit 0, single-slash names, valid JSON) and fail while the bug is present; the @tdd_expected_fail handler inverts results so CI stays green. Includes Robot Framework integration smoke tests (3), ASV benchmarks (3), and a shared FakeProviderInfo/FakeProviderRegistry mock in features/mocks/fake_provider.py. ISSUES CLOSED: #634 |
||
|
|
4fff7f67c5 |
fix(test): use scoped_session to prevent GC-induced data loss in r2cov
CI / benchmark-publish (pull_request) Has been skipped
CI / build (pull_request) Successful in 16s
CI / lint (pull_request) Successful in 17s
CI / quality (pull_request) Successful in 18s
CI / security (pull_request) Successful in 35s
CI / typecheck (pull_request) Successful in 38s
CI / unit_tests (pull_request) Successful in 2m35s
CI / docker (pull_request) Successful in 39s
CI / integration_tests (pull_request) Successful in 3m22s
CI / coverage (pull_request) Successful in 6m4s
CI / benchmark-regression (pull_request) Has been cancelled
SQLite in-memory engines use SingletonThreadPool, giving every Session the same underlying connection. Repository methods create a new Session via the factory, flush, then return — letting the Session go out of scope. Under high memory pressure (e.g. 32 parallel behave workers) Python's garbage collector closes these orphaned Sessions, issuing an implicit ROLLBACK on the shared connection and wiping flushed-but-uncommitted rows written by other Sessions. Replace the plain sessionmaker with scoped_session in the r2cov Background step so that every factory() call returns the same Session instance. A single long-lived Session per scenario eliminates the premature close/rollback window entirely. Verified: 3 consecutive green runs with --processes 32 (10 099 scenarios, 0 failures each). Refs: #570 |
||
|
|
1e116e3fec |
Merge branch 'master' into tdd/session-list-di-error
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 15s
CI / build (pull_request) Successful in 18s
CI / quality (pull_request) Successful in 19s
CI / security (pull_request) Successful in 37s
CI / typecheck (pull_request) Successful in 38s
CI / unit_tests (pull_request) Successful in 2m50s
CI / docker (pull_request) Successful in 9s
CI / integration_tests (pull_request) Successful in 3m31s
CI / coverage (pull_request) Successful in 5m27s
CI / benchmark-regression (pull_request) Successful in 32m48s
|
||
|
|
1be8dd9cb9 |
Merge branch 'master' into feature/m3-fix-session-list-error
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 13s
CI / build (pull_request) Successful in 17s
CI / quality (pull_request) Successful in 17s
CI / security (pull_request) Successful in 34s
CI / typecheck (pull_request) Successful in 37s
CI / unit_tests (pull_request) Successful in 4m32s
CI / docker (pull_request) Successful in 16s
CI / integration_tests (pull_request) Successful in 5m9s
CI / coverage (pull_request) Successful in 6m26s
CI / benchmark-regression (pull_request) Successful in 33m0s
|
||
|
|
d0689573e0 |
test(cli): add failing tests for session create DI container error
CI / lint (pull_request) Successful in 13s
CI / benchmark-publish (pull_request) Has been skipped
CI / quality (pull_request) Successful in 18s
CI / build (pull_request) Successful in 32s
CI / security (pull_request) Successful in 48s
CI / typecheck (pull_request) Successful in 55s
CI / unit_tests (pull_request) Failing after 2m41s
CI / docker (pull_request) Has been skipped
CI / integration_tests (pull_request) Successful in 3m25s
CI / coverage (pull_request) Successful in 5m56s
CI / benchmark-regression (pull_request) Successful in 33m35s
Add TDD regression tests for bug #570 where `_get_session_service()` calls `container.db()` but the DI `Container` class has no `db` provider, raising `AttributeError`. Same root cause as bug #554. Includes 4 Behave BDD scenarios tagged `@tdd_bug @tdd_bug_570 @tdd_expected_fail`, Robot Framework integration smoke tests with `--format plain`, and ASV service-layer benchmarks. Tests exercise the real DI path by resetting `_service = None` and using a file-based SQLite database. Implements the `@tdd_expected_fail` inversion infrastructure: - Behave: `after_scenario` hook in `features/environment.py` inverts pass/fail for scenarios tagged `@tdd_expected_fail` - Robot: `robot/tdd_expected_fail_listener.py` listener (API v3) performs the same inversion for Robot test cases - `noxfile.py`: registers the listener via `--listener` in both the `integration_tests` and `slow_integration_tests` sessions Migrates 18 existing TDD scenarios across 5 feature files from the old `@tdd @bugNNN` convention to the standardised `@tdd_bug @tdd_bug_NNN` tags per CONTRIBUTING.md § TDD Bug Test Tags. Refs: #570 |
||
|
|
4c5589da4e |
test(cli): add failing TDD tests for session list DI container error
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 15s
CI / build (pull_request) Successful in 16s
CI / quality (pull_request) Successful in 18s
CI / typecheck (pull_request) Successful in 37s
CI / security (pull_request) Successful in 39s
CI / unit_tests (pull_request) Successful in 3m11s
CI / integration_tests (pull_request) Successful in 3m15s
CI / docker (pull_request) Successful in 9s
CI / coverage (pull_request) Successful in 5m15s
CI / benchmark-regression (pull_request) Successful in 32m13s
Add 10 Behave BDD scenarios (@tdd_bug @tdd_bug_554 @tdd_expected_fail) for the session list DI wiring bug where _get_session_service() calls container.db() but the Container has no db provider (AttributeError). Scenarios cover empty list, format validation (JSON/YAML/plain/rich), init-then-list lifecycle, and post-create list paths. Implement @tdd_expected_fail infrastructure: Behave after_scenario hook inverts FAIL→PASS (expected) and PASS→FAIL (unexpected fix), plus Robot Framework listener (Listener API v3) with identical semantics registered via --listener in both integration_tests and slow_integration_tests nox sessions. Migrate 18 existing TDD scenarios across 5 feature files from legacy @tdd @bugNNN convention to @tdd_bug @tdd_bug_NNN per CONTRIBUTING.md § TDD Bug Test Tags. Includes Robot Framework integration smoke tests and ASV service-layer benchmarks. Refs: #554 |
||
|
|
471426f5b6 |
Merge branch 'master' into tdd/session-create-di-error
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 16s
CI / build (pull_request) Successful in 16s
CI / quality (pull_request) Successful in 17s
CI / security (pull_request) Successful in 35s
CI / typecheck (pull_request) Successful in 51s
CI / unit_tests (pull_request) Successful in 2m40s
CI / docker (pull_request) Successful in 39s
CI / integration_tests (pull_request) Successful in 3m21s
CI / coverage (pull_request) Successful in 6m38s
CI / benchmark-regression (pull_request) Successful in 32m8s
|
||
|
|
c054675167 |
feat(resource): add database resources
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 15s
CI / quality (pull_request) Successful in 18s
CI / build (pull_request) Successful in 17s
CI / typecheck (pull_request) Successful in 38s
CI / security (pull_request) Successful in 40s
CI / integration_tests (pull_request) Successful in 4m5s
CI / unit_tests (pull_request) Successful in 4m56s
CI / coverage (pull_request) Successful in 5m13s
CI / docker (pull_request) Successful in 1m10s
CI / lint (push) Successful in 13s
CI / quality (push) Successful in 19s
CI / build (push) Successful in 17s
CI / security (push) Successful in 37s
CI / typecheck (push) Successful in 40s
CI / benchmark-regression (push) Has been skipped
CI / unit_tests (push) Successful in 2m59s
CI / integration_tests (push) Successful in 3m24s
CI / docker (push) Successful in 40s
CI / coverage (push) Successful in 5m14s
CI / benchmark-publish (push) Successful in 17m55s
CI / benchmark-regression (pull_request) Successful in 34m15s
Implement database resource types (postgres, mysql, sqlite, duckdb) with connection args, auth handling, and transaction-based sandbox strategy using BEGIN/ROLLBACK/COMMIT wrappers. Key changes: - Add DatabaseResourceHandler with 4 database type definitions - Implement TransactionSandbox for transaction_rollback strategy - Wire TransactionSandbox into SandboxFactory - Register database types in bootstrap_builtin_types - Add connection validation with credential masking - Add Behave BDD tests, Robot integration tests, ASV benchmarks ISSUES CLOSED: #342 |
||
|
|
9ee4c4aa2d |
Merge pull request 'fix(test): resolve race condition in M4 validation integration test' (#619) from fix/m4-validation-race-condition into master
CI / lint (push) Successful in 15s
CI / build (push) Successful in 15s
CI / quality (push) Successful in 19s
CI / typecheck (push) Successful in 39s
CI / benchmark-regression (push) Has been skipped
CI / security (push) Successful in 44s
CI / unit_tests (push) Failing after 2m39s
CI / docker (push) Has been skipped
CI / integration_tests (push) Successful in 3m25s
CI / coverage (push) Successful in 5m4s
CI / benchmark-publish (push) Successful in 18m47s
Reviewed-on: #619 Reviewed-by: Rui Hu <rui.hu@cleverthis.com> |
||
|
|
b80a9232fa |
test(session): add TDD failing tests for session create DI error
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 28s
CI / build (pull_request) Successful in 16s
CI / quality (pull_request) Successful in 38s
CI / security (pull_request) Successful in 1m11s
CI / typecheck (pull_request) Successful in 1m15s
CI / unit_tests (pull_request) Successful in 6m16s
CI / docker (pull_request) Successful in 10s
CI / integration_tests (pull_request) Successful in 6m39s
CI / coverage (pull_request) Successful in 5m24s
CI / benchmark-regression (pull_request) Successful in 32m27s
Implement TDD bug-capture tests for bug #570 where `agents session create` fails because `_get_session_service()` calls `container.db()` which does not exist on the DI Container class (AttributeError). Same root cause as bug #554. Behave BDD scenarios tagged @tdd_bug @tdd_bug_570 @tdd_expected_fail exercise the real DI path (no mocks). Includes Robot Framework integration smoke tests with self-inverting helper and ASV benchmark baseline. ISSUES CLOSED: #631 |
||
|
|
06bbe48a9c |
test(session): add TDD failing tests for session list DI error
CI / lint (pull_request) Successful in 21s
CI / benchmark-publish (pull_request) Has been skipped
CI / quality (pull_request) Successful in 36s
CI / build (pull_request) Successful in 24s
CI / typecheck (pull_request) Successful in 59s
CI / security (pull_request) Successful in 1m14s
CI / unit_tests (pull_request) Successful in 3m27s
CI / docker (pull_request) Successful in 40s
CI / integration_tests (pull_request) Successful in 6m40s
CI / coverage (pull_request) Successful in 5m12s
CI / benchmark-regression (pull_request) Successful in 32m46s
Implement TDD bug-capture tests for bug #554 where `agents session list` fails because `_get_session_service()` calls `container.db()` which does not exist on the DI Container class (AttributeError). Behave BDD scenarios tagged @tdd_bug @tdd_bug_554 @tdd_expected_fail exercise the real DI path (no mocks) and assert correct behavior. The @tdd_expected_fail handler in environment.py inverts failed→passed while the bug is present, keeping CI green. Also adds: - @tdd_expected_fail infrastructure in features/environment.py (tag validation + status inversion in after_scenario hook) - behave-parallel exit logic fix to use summary-based failure detection (compatible with TDD status inversion) - Robot Framework integration smoke tests with self-inverting helper - ASV benchmark baseline for session list command throughput ISSUES CLOSED: #630 |
||
|
|
d88dad94f6 |
fix(test): resolve race condition in M4 validation integration test
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 25s
CI / quality (pull_request) Successful in 25s
CI / build (pull_request) Successful in 26s
CI / typecheck (pull_request) Successful in 1m9s
CI / security (pull_request) Successful in 1m18s
CI / integration_tests (pull_request) Successful in 3m43s
CI / unit_tests (pull_request) Successful in 4m8s
CI / docker (pull_request) Successful in 43s
CI / coverage (pull_request) Successful in 5m35s
CI / benchmark-regression (pull_request) Successful in 32m44s
Three-pronged fix for intermittent pabot-parallel race condition in M4 validation integration tests: 1. Composable Setup Database Isolation keyword in common.resource gives each suite a unique CLEVERAGENTS_DATABASE_URL so concurrent pabot workers never contend on the same SQLite file. 2. Per-suite CLEVERAGENTS_HOME directories prevent shared temp directory cleanup from racing between workers. 3. Centralised reset_global_state() in robot/helpers_common.py clears Settings singleton, DI container, provider registry, and engine cache between chained CLI invocations in helper processes. Also: - Setup Test Environment now accepts optional mock_ai and auto_apply_migrations arguments (default TRUE) for backward compatibility while allowing suites to opt out. - Added Suite Teardown to cli_plan_context_commands.robot. - Fixed _COMMANDS typing in two helpers to eliminate type: ignore. - Updated docs/development/testing.md to reflect helpers_common delegation pattern. - Added timeout=30s to all Run Process calls in m4_e2e_verification.robot. Fixes: #563 |
||
|
|
876217d0ca |
feat(guardrails): implement Per-Session and Per-Org Cost Budgets
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 16s
CI / build (pull_request) Successful in 16s
CI / quality (pull_request) Successful in 24s
CI / typecheck (pull_request) Successful in 37s
CI / security (pull_request) Successful in 44s
CI / unit_tests (pull_request) Successful in 2m40s
CI / integration_tests (pull_request) Successful in 3m19s
CI / docker (pull_request) Successful in 42s
CI / coverage (pull_request) Successful in 5m10s
CI / lint (push) Successful in 12s
CI / build (push) Successful in 16s
CI / quality (push) Successful in 21s
CI / security (push) Successful in 32s
CI / typecheck (push) Successful in 37s
CI / benchmark-regression (push) Has been skipped
CI / unit_tests (push) Failing after 2m36s
CI / docker (push) Has been skipped
CI / integration_tests (push) Successful in 3m16s
CI / coverage (push) Successful in 5m3s
CI / benchmark-publish (push) Successful in 17m54s
CI / benchmark-regression (pull_request) Successful in 31m55s
Implements Forgejo issue #584: three-tier budget hierarchy (per-plan -> per-session -> per-org) with tightest limit winning. Domain models: - BudgetLevel enum (PLAN, SESSION, ORG) - BudgetCheckResult (frozen Pydantic model with exceeded_level, warning) - SessionCostBudget (tracks per-session accumulated cost) - OrgCostAccumulator (tracks per-org accumulated cost) - ThreadSafeOrgCostAccumulator (thread-safe wrapper with snapshot) Application services: - CostBudgetService: manages budget state, enforces hierarchy, emits BUDGET_WARNING (once per session) and BUDGET_EXCEEDED events - AutonomyGuardrailService: extended with associate_plan_with_session, check_budget_hierarchy, record_plan_cost_to_session methods Configuration: - Settings: session_max_cost_usd, org_max_cost_usd, budget_warning_threshold Integration: - Session model: cost_budget field, as_cli_dict includes budget data - DI container: CostBudgetService registered as Singleton - CLI session show: cost budget panel display Tests: - 54 Behave scenarios (features/cost_budgets.feature) - 11 Robot Framework integration tests (robot/cost_budgets.robot) - ASV benchmarks (benchmarks/bench_budget_check.py) All nox stages pass: lint, typecheck, unit_tests, coverage_report (98%). CLOSES #584 |
||
|
|
958eb0c060 |
feat(observability): implement Metrics Collection Framework (14 metric types with Histogram/Counter/Gauge)
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 15s
CI / build (pull_request) Successful in 17s
CI / quality (pull_request) Successful in 19s
CI / typecheck (pull_request) Successful in 37s
CI / security (pull_request) Successful in 51s
CI / unit_tests (pull_request) Successful in 2m41s
CI / integration_tests (pull_request) Successful in 3m19s
CI / docker (pull_request) Successful in 51s
CI / coverage (pull_request) Successful in 5m7s
CI / benchmark-regression (pull_request) Successful in 33m26s
CI / lint (push) Successful in 13s
CI / build (push) Successful in 15s
CI / quality (push) Successful in 16s
CI / security (push) Successful in 33s
CI / typecheck (push) Successful in 35s
CI / benchmark-regression (push) Has been skipped
CI / unit_tests (push) Successful in 3m2s
CI / integration_tests (push) Successful in 3m12s
CI / docker (push) Successful in 49s
CI / coverage (push) Successful in 6m10s
CI / benchmark-publish (push) Has been cancelled
Implement the structured metrics collection framework covering 14 operational metric types with proper Histogram, Counter, and Gauge semantics per the spec (Architecture > Observability > Metrics Collection, lines ~43805-43825). Domain layer: - Add MetricType enum (HISTOGRAM, COUNTER, GAUGE) to metrics.py - Add MetricDefinition model and METRIC_DEFINITIONS registry mapping all 14 OperationalMetricKey values to their metric types - Extend MetricCollector with typed factory methods (histogram, counter, gauge) and 14 convenience methods (plan_duration, plan_cost, plan_decision_count, subplan_count, actor_invocation_count, actor_latency, tool_invocation_count, tool_error_rate, context_build_time, context_token_count, llm_call_count, llm_total_tokens, llm_total_cost, llm_avg_latency) - Extend MetricEntry with optional metric_type field that auto-resolves from METRIC_DEFINITIONS via MetricCollector.record() Infrastructure layer: - Add MetricsEmitter (infrastructure/observability/metrics_emitter.py) with emit(), emit_batch(), from_settings(), and enabled/disabled support for structured log emission in local mode - Add metrics_log_processor (config/metrics_processor.py) for structlog integration Configuration: - Add metrics_enabled and metrics_export_prometheus settings - Register MetricsEmitter as DI Singleton in application container Instrumentation: - Add best-effort metric emission in PlanExecutor for plan_duration (both runtime and stub execute paths) and plan_decision_count (strategize path) via _try_emit_metric helper that tolerates invalid plan IDs in test fixtures Testing: - 34 Behave BDD scenarios (features/observability/metrics_collection.feature) - 8 Robot Framework integration tests (robot/metrics_collection.robot) - ASV benchmark suite (benchmarks/bench_metrics_collection.py) Closes #579 |
||
|
|
c2db74ba81 |
Docs: Restyled ADR pages
CI / lint (push) Successful in 15s
CI / build (push) Successful in 16s
CI / quality (push) Successful in 20s
CI / security (push) Successful in 35s
CI / typecheck (push) Successful in 42s
CI / benchmark-regression (push) Has been skipped
CI / unit_tests (push) Successful in 2m38s
CI / integration_tests (push) Successful in 3m11s
CI / docker (push) Successful in 39s
CI / coverage (push) Successful in 4m58s
CI / benchmark-publish (push) Successful in 17m32s
|
||
|
|
01a2a03e2e | Docs: Improved the navigation seperating out ToC from top nac bar | ||
|
|
a41fc02f11 |
feat(acms): add strategy coordinator and fusion engine
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 14s
CI / build (pull_request) Successful in 17s
CI / quality (pull_request) Successful in 18s
CI / security (pull_request) Successful in 35s
CI / typecheck (pull_request) Successful in 41s
CI / unit_tests (pull_request) Successful in 2m30s
CI / integration_tests (pull_request) Successful in 3m7s
CI / docker (pull_request) Successful in 54s
CI / coverage (pull_request) Successful in 5m42s
CI / lint (push) Successful in 12s
CI / build (push) Successful in 16s
CI / quality (push) Successful in 18s
CI / security (push) Successful in 33s
CI / typecheck (push) Successful in 36s
CI / benchmark-regression (push) Has been skipped
CI / unit_tests (push) Successful in 2m45s
CI / integration_tests (push) Successful in 3m11s
CI / docker (push) Successful in 46s
CI / coverage (push) Successful in 5m52s
CI / benchmark-publish (push) Successful in 17m26s
CI / benchmark-regression (pull_request) Successful in 31m25s
Implement StrategyCoordinator and FusionEngine as named facades over the existing ACMS pipeline components, providing clean public APIs for parallel strategy execution with proportional budget allocation and fragment fusion with dedup/conflict resolution/knapsack packing. Key changes: - Add StrategyCoordinator with parallel execution and confidence-based budget allocation - Add FusionEngine with URI+hash dedup, max-depth conflict resolution, greedy knapsack packing - Add budget overage guard with lowest-relevance fragment dropping - Add per-strategy max caps enforcement - Wire into existing ContextAssemblyPipeline - Add Behave BDD tests, Robot integration tests, ASV benchmarks - Add docs/reference/acms_fusion.md ISSUES CLOSED: #192 |
||
|
|
521a552e56 |
feat(extensibility): implement Plugin Architecture Framework with module:ClassName resolution
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 14s
CI / build (pull_request) Successful in 15s
CI / quality (pull_request) Successful in 19s
CI / typecheck (pull_request) Successful in 37s
CI / security (pull_request) Successful in 51s
CI / unit_tests (pull_request) Successful in 2m31s
CI / integration_tests (pull_request) Successful in 3m27s
CI / docker (pull_request) Successful in 56s
CI / coverage (pull_request) Successful in 6m7s
CI / lint (push) Successful in 12s
CI / build (push) Successful in 14s
CI / quality (push) Successful in 17s
CI / security (push) Successful in 42s
CI / typecheck (push) Successful in 44s
CI / benchmark-regression (push) Has been skipped
CI / unit_tests (push) Successful in 2m37s
CI / docker (push) Successful in 39s
CI / integration_tests (push) Successful in 3m24s
CI / coverage (push) Successful in 5m9s
CI / benchmark-publish (push) Has been cancelled
CI / benchmark-regression (pull_request) Successful in 32m7s
Implement plugin architecture framework enabling custom implementations of tools, strategies, sandbox strategies, index backends, and pipeline components through module:ClassName resolution and entry point discovery. Key changes: - Add infrastructure/plugins/ package with PluginLoader, PluginManager, types, exceptions - Implement dynamic import via module:ClassName with security prefix allowlist - Add entry point discovery via importlib.metadata - Add Protocol validation for loaded plugin classes - Add plugin lifecycle management (discover/activate/deactivate) - Add config-driven registration (custom_module + custom_class + custom_options) - Register PluginManager in DI container - Add comprehensive Behave BDD tests, Robot integration tests, ASV benchmarks ISSUES CLOSED: #585 |
||
|
|
cf67ba0a86
|
feat(devcontainer): add lazy activation and lifecycle management
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 15s
CI / build (pull_request) Successful in 16s
CI / quality (pull_request) Successful in 18s
CI / security (pull_request) Successful in 35s
CI / typecheck (pull_request) Successful in 37s
CI / unit_tests (pull_request) Successful in 2m27s
CI / docker (pull_request) Successful in 49s
CI / integration_tests (pull_request) Successful in 3m46s
CI / coverage (pull_request) Successful in 4m56s
CI / lint (push) Successful in 12s
CI / build (push) Successful in 14s
CI / quality (push) Successful in 16s
CI / security (push) Successful in 32s
CI / typecheck (push) Successful in 36s
CI / benchmark-regression (push) Has been skipped
CI / unit_tests (push) Successful in 4m7s
CI / integration_tests (push) Successful in 4m41s
CI / docker (push) Successful in 44s
CI / coverage (push) Successful in 4m56s
CI / benchmark-publish (push) Successful in 17m17s
CI / benchmark-regression (pull_request) Successful in 31m25s
Implemented lazy container activation for devcontainer-instance resources with ContainerLifecycleState enum tracking six states (inactive, starting, active, stopping, stopped, error) with validated transitions. Extended DevcontainerHandler with devcontainer up CLI integration and JSON output parsing for container start. Added periodic health checking via devcontainer exec ping with configurable interval. Added agents resource stop and agents resource rebuild CLI commands for manual lifecycle control. Wired session close and plan completion hooks to automatic container cleanup. Includes lifecycle state persistence in resource registry with timestamped transitions. Added Behave BDD tests, Robot integration tests, and ASV activation latency benchmarks. - Added remoteWorkspaceFolder absolute-path validation - Aligned spec: handler name, rebuild types, --yes flag on stop/rebuild - Added registry re-read in stop_container success path for consistency - Added session_id field to ContainerLifecycleTracker for scoped cleanup - Scoped stop_all_active_containers to session_id when provided - Wired _cleanup_devcontainers into fail_apply and fail_execute - Wired start_health_check into activate_container success path - Restructured facade session close to always run container cleanup even without session service (F4) - Re-read tracker from registry in activate_container success path - Added evict_terminal_trackers to cap registry growth - Updated devcontainer_resources.md: health check auto-start, scoped cleanup hooks, known limitations for eviction and sandbox_strategy - Wired evict_terminal_trackers into stop_all_active_containers so terminal-state trackers are actually evicted in production - Made stop_container idempotent: returns early when container is already in a terminal state instead of raising ValueError - Fixed benchmark health check thread leak in TimeActivationLatency by clearing registry after each timing loop - Added rebuild pass-through (--reset-container flag to devcontainer up) - Added host_workspace_path field on ContainerLifecycleTracker so health probes use the host-side path for devcontainer exec - Wired lazy activation into DevcontainerHandler.resolve() for devcontainer-instance resources in non-running states - Changed _default_strategy from SNAPSHOT to NONE (container itself provides isolation; SandboxFactory raises NotImplementedError for snapshot) - Restricted _STOPPABLE_TYPES to devcontainer-instance only (container-instance is not directly stoppable via CLI) ISSUES CLOSED: #514 |
||
|
|
1b4e021659 |
Merge pull request 'feat(resource): add resource type inheritance and polymorphic tool matching' (#618) from feature/m6-resource-type-inheritance into master
CI / lint (push) Successful in 15s
CI / build (push) Successful in 16s
CI / quality (push) Successful in 18s
CI / security (push) Successful in 36s
CI / typecheck (push) Successful in 38s
CI / benchmark-regression (push) Has been skipped
CI / unit_tests (push) Successful in 2m38s
CI / integration_tests (push) Successful in 3m14s
CI / docker (push) Successful in 49s
CI / coverage (push) Successful in 5m7s
CI / benchmark-publish (push) Successful in 18m7s
Reviewed-on: #618 Reviewed-by: Brent Edwards <brent.edwards@cleverthis.com> |
||
|
|
45c15bcc1a |
fix(migration): chain m6_004 after m7_001_repo_indexing_tables to resolve multiple heads
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 15s
CI / build (pull_request) Successful in 17s
CI / quality (pull_request) Successful in 17s
CI / security (pull_request) Successful in 34s
CI / typecheck (pull_request) Successful in 37s
CI / unit_tests (pull_request) Successful in 2m35s
CI / integration_tests (pull_request) Successful in 3m7s
CI / docker (pull_request) Successful in 40s
CI / coverage (pull_request) Successful in 4m56s
CI / benchmark-regression (pull_request) Successful in 31m53s
m6_004_resource_type_inherits and m7_001_repo_indexing_tables both had down_revision='m6_003_async_jobs_table', creating two Alembic heads. Chain m6_004 after m7_001 so the migration graph is linear. |
||
|
|
135481f9a6 |
fix(resource): address PR #618 review findings (round 1)
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 14s
CI / quality (pull_request) Successful in 18s
CI / build (pull_request) Successful in 16s
CI / unit_tests (pull_request) Failing after 25s
CI / security (pull_request) Successful in 34s
CI / typecheck (pull_request) Successful in 36s
CI / docker (pull_request) Has been skipped
CI / coverage (pull_request) Failing after 25s
CI / integration_tests (pull_request) Failing after 2m19s
CI / benchmark-regression (pull_request) Has been cancelled
- P2-1: Add field_validator('inherits') on ResourceTypeSpec
- P2-2: Remove 'properties' from _COLLECTION_FIELDS (scalar override)
- P2-3: Add behave scenarios for exception rollback paths
- P2-4: Add ordering comment to BUILTIN_TYPES
- P2-5: Define RegistryHost Protocol, remove type:ignore on mixins
- P2-6: Add if_not_exists=True on migration index creation
- P3-1: Use deque.popleft() in get_ancestors for O(1) BFS
- P3-2: Filter private attrs in _to_dict vars() fallback
- P3-3: Replace _handler_cache import with clear_handler_cache()
- P3-4: Add migration downgrade test for m6_004
- P3-5: Extract ResourceDagMixin to _resource_registry_dag.py
All files remain under 500-line CONTRIBUTING limit.
Lint, typecheck, and 85 behave scenarios pass.
|
||
|
|
ab4da7804d |
test(resource): add diff-coverage BDD scenarios for inheritance service and resolver
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 15s
CI / build (pull_request) Successful in 16s
CI / quality (pull_request) Successful in 22s
CI / unit_tests (pull_request) Failing after 26s
CI / security (pull_request) Successful in 35s
CI / typecheck (pull_request) Successful in 37s
CI / docker (pull_request) Has been skipped
CI / coverage (pull_request) Failing after 23s
CI / integration_tests (pull_request) Failing after 2m19s
CI / benchmark-regression (pull_request) Has been cancelled
Add 21 scenarios covering uncovered paths in: - resource_registry_service.py: register_type inherits validation, remove_type guards, resolve_chain, is_subtype_of (76% -> 95%) - resolver.py: import error, instantiation, protocol check, polymorphic chain walk (77% -> 98%) - _resource_registry_ops.py: exact filter, child type mismatch, tree type_filter (95% -> 98%) - inheritance.py: _merge_dict, resolve_fields gap (96% -> 99%) Overall project coverage holds at 97%. |
||
|
|
bebe91e0a7 |
fix(resource): add defensive copies for capabilities/auto_discovery/equivalence in as_cli_dict
Complete F24 fix: capabilities, auto_discovery, and equivalence dicts were returned as direct references. Now wrapped with dict() to prevent callers from mutating internal state. |
||
|
|
ce1536c4c4 |
refactor(resource): split resource_registry_service into 3 modules (<500 LOC each)
Extract data helpers (_resource_registry_data.py, 389 lines) and operation mixins (_resource_registry_ops.py, 497 lines) from the 1247-line resource_registry_service.py, reducing it to 467 lines. All three modules stay under the 500-line CONTRIBUTING limit. Backward-compat aliases (_spec_to_db, _db_to_spec) are re-exported from the main module so existing test imports continue to work. Addresses review finding F8 for PR #618. |
||
|
|
23d8a53f6a |
fix(resource): address review findings for resource type inheritance
Fix 25 of 27 review findings from PR #618 code review: P1 (Must Fix): - F3: Fix silent data corruption in _merge_collection for properties dict fields (was falling through to string list merge) - F1: Split 1023-line step file into 3 files + helper module (all <500) - F4: Add SELECT FOR UPDATE lock on parent type in register_type to prevent TOCTOU race in concurrent registrations - F6: Fix docs claiming exceptions inherit from CleverAgentsError (they inherit from ValueError) - F7: Fix docs incorrectly describing validate_chain return type P2 (Should Fix): - F9: Replace dict[str, Any] with TypeRegistryMap type alias - F10: Replace import logging with structlog in inheritance.py - F11: Add __all__ to inheritance.py - F13: Fix _load_type_registry to derive built_in from namespace column - F14: Add warning log for unregistered types in resolve_inheritance_chain - F15: Return defensive copies from resolve_fields - F16: Add chain validation to bootstrap_builtin_types - F17: Narrow except Exception to specific types in step files - F18: Add side-effect verification scenarios after error cases - F19: Always include inherits key in JSON output for consistent schema - F20: Log actual exception instead of hardcoded string in CLI P3 (Nit): - F21: Reject whitespace-only inherits values in validate_chain - F23: Wrap chain errors in HandlerResolutionError in resolver - F24: Return defensive copies from as_cli_dict - F25: Replace tautological assertion with ResourceHandler isinstance - F26: Add whitespace inherits test scenario - F27: Fix find_subtypes docstring to note it excludes ancestor_name Deferred: - F2: type: ignore in step files — pyright only checks src/, matches existing project pattern (91 occurrences in resource_dag_steps.py) - F5: CLI integration tests require full DI container setup - F8: resource_registry_service.py size is pre-existing (971 on master) - F12: Coverage boost file changes are test adaptations, not scope creep - F22: FK constraint intentionally omitted per docs (SQLite compat) |
||
|
|
bb8175aa11 |
feat(resource): add resource type inheritance and polymorphic tool matching
Implement ADR-042 single-inheritance for resource types with polymorphic tool and handler resolution. Core changes: - Add `inherits` field to ResourceTypeConfigSchema, ResourceTypeSpec, and ResourceTypeModel with chain depth validation (max 5), circular inheritance detection, and built-in-from-custom guard - New inheritance.py module (390 lines): resolve_inheritance_chain(), validate_chain(), is_subtype_of(), resolve_fields(), find_subtypes() - Wire inheritance into ResourceRegistryService: chain validation on register_type(), resolve_type_inheritance_chain(), is_subtype_of() - Add find_tools_for_resource() to ToolRegistry with polymorphic matching that walks the inheritance chain - Add resolve_handler_polymorphic() to handler resolver - Alembic migration m6_004_resource_type_inherits adds inherits column and index to resource_types table CLI changes: - `agents resource type list` shows Inherits column - `agents resource type show` displays inheritance chain Tests: - 30 BDD scenarios in resource_type_inheritance.feature (all pass) - 18 Robot Framework test cases - 14 ASV benchmark timing methods across 4 suites Docs: - docs/reference/resource_type_inheritance.md (full reference) - Updated docs/schema/resource_type.schema.yaml - CHANGELOG entry for #513 ISSUES CLOSED: #513 |
||
|
|
fcdf80f342 |
Merge pull request 'feat(context): add repo indexing service' (#610) from feature/m4-context-indexing into master
CI / lint (push) Successful in 16s
CI / build (push) Successful in 17s
CI / quality (push) Successful in 21s
CI / typecheck (push) Successful in 39s
CI / benchmark-regression (push) Has been skipped
CI / security (push) Successful in 41s
CI / unit_tests (push) Successful in 2m59s
CI / integration_tests (push) Successful in 3m12s
CI / docker (push) Successful in 40s
CI / coverage (push) Successful in 4m52s
CI / benchmark-publish (push) Successful in 17m14s
Reviewed-on: #610 Reviewed-by: Brent Edwards <brent.edwards@cleverthis.com> |
||
|
|
7d958121ad |
feat(context): add repo indexing service
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 16s
CI / build (pull_request) Successful in 16s
CI / quality (pull_request) Successful in 23s
CI / security (pull_request) Successful in 35s
CI / typecheck (pull_request) Successful in 43s
CI / unit_tests (pull_request) Successful in 2m40s
CI / integration_tests (pull_request) Successful in 3m10s
CI / docker (pull_request) Successful in 40s
CI / coverage (pull_request) Successful in 5m1s
CI / benchmark-regression (pull_request) Successful in 31m13s
Add RepoIndexingService with incremental refresh, language detection, SHA-256 hashing, and policy enforcement. Includes domain models, DB persistence, DI wiring, Behave/Robot/ASV tests, and reference docs. ISSUES CLOSED: #195 |
||
|
|
83f2f3a0a1
|
Docs: Daily update to timeline
CI / lint (push) Successful in 15s
CI / build (push) Successful in 17s
CI / quality (push) Successful in 19s
CI / security (push) Successful in 35s
CI / typecheck (push) Successful in 55s
CI / benchmark-regression (push) Has been skipped
CI / unit_tests (push) Successful in 2m31s
CI / docker (push) Successful in 10s
CI / integration_tests (push) Successful in 3m9s
CI / coverage (push) Successful in 4m52s
CI / benchmark-publish (push) Successful in 17m27s
|
||
|
|
0a8f054241
|
Docs: Fixed missing items from nav bar
CI / lint (push) Successful in 16s
CI / build (push) Successful in 17s
CI / quality (push) Successful in 18s
CI / security (push) Successful in 34s
CI / typecheck (push) Successful in 39s
CI / benchmark-regression (push) Has been skipped
CI / unit_tests (push) Successful in 2m45s
CI / integration_tests (push) Successful in 3m15s
CI / docker (push) Successful in 1m0s
CI / coverage (push) Successful in 5m47s
CI / benchmark-publish (push) Successful in 18m31s
|
||
|
|
e8d777825b
|
Docs: daily update to timeline
CI / lint (push) Successful in 16s
CI / quality (push) Successful in 18s
CI / build (push) Successful in 18s
CI / security (push) Successful in 38s
CI / typecheck (push) Successful in 50s
CI / benchmark-regression (push) Has been skipped
CI / benchmark-publish (push) Has been cancelled
CI / integration_tests (push) Has been cancelled
CI / unit_tests (push) Has been cancelled
CI / coverage (push) Has been cancelled
CI / docker (push) Has been cancelled
|
||
|
|
a808c395f9 |
test(coverage): add Behave BDD tests to improve unit test coverage across 53 source modules
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 15s
CI / build (pull_request) Successful in 15s
CI / quality (pull_request) Successful in 17s
CI / typecheck (pull_request) Successful in 35s
CI / security (pull_request) Successful in 50s
CI / unit_tests (pull_request) Successful in 2m46s
CI / integration_tests (pull_request) Successful in 3m16s
CI / docker (pull_request) Successful in 40s
CI / coverage (pull_request) Successful in 5m6s
CI / lint (push) Successful in 13s
CI / quality (push) Successful in 16s
CI / build (push) Successful in 18s
CI / security (push) Successful in 32s
CI / typecheck (push) Successful in 35s
CI / benchmark-regression (push) Has been skipped
CI / unit_tests (push) Successful in 2m52s
CI / integration_tests (push) Successful in 3m8s
CI / docker (push) Successful in 39s
CI / coverage (push) Successful in 5m53s
CI / benchmark-publish (push) Successful in 16m55s
CI / benchmark-regression (pull_request) Successful in 33m0s
Add 53 new .feature files and corresponding step definition files targeting uncovered lines identified in build/coverage.xml. Fix AmbiguousStep conflicts in 7 pre-existing step files by disambiguating step text. New tests cover: ACP clients/facade, actor CLI/config, application container, ACMS service/strategies, async worker, automation profile CLI, autonomy guardrail, bridge, change model, config CLI/service, context service, cross-plan correction, database models, decision service, decomposition clustering/service, discovery handler, langchain chat provider, langgraph nodes, materializers, multi-project service, plan apply/CLI/lifecycle/model/ preflight/resume/service, PostgreSQL analyzer, project CLI/context CLI, provider registry, reactive application/route, repositories, resolver handler, resource registry service, resume model, retry patterns, sandbox protocol, server CLI, skill CLI/service, skills registry, subplan execution/service, system CLI, UKO loader, UoW, and YAML template engine. Closes #645 |
||
|
|
e5c0b10985
|
Docs: Fided some discrepencies in timeline
CI / lint (push) Successful in 15s
CI / build (push) Successful in 18s
CI / quality (push) Successful in 19s
CI / security (push) Successful in 34s
CI / typecheck (push) Successful in 36s
CI / benchmark-regression (push) Has been skipped
CI / unit_tests (push) Successful in 2m18s
CI / docker (push) Successful in 16s
CI / integration_tests (push) Successful in 3m29s
CI / coverage (push) Successful in 6m23s
CI / benchmark-publish (push) Successful in 17m10s
|
||
|
|
16dc4ab18d |
fix(project): show created project after creation (#593)
CI / lint (push) Successful in 16s
CI / build (push) Successful in 16s
CI / quality (push) Successful in 19s
CI / security (push) Successful in 34s
CI / typecheck (push) Successful in 38s
CI / benchmark-regression (push) Has been skipped
CI / unit_tests (push) Successful in 2m24s
CI / docker (push) Successful in 40s
CI / integration_tests (push) Successful in 3m20s
CI / coverage (push) Successful in 5m25s
CI / benchmark-publish (push) Successful in 16m50s
## Summary Fix `agents project show` not finding a project immediately after creation. Extends the `session.commit()` fix from #589 to also cover `update()` and `delete()` in `NamespacedProjectRepository`. ## Changes **Production fix** (`src/cleveragents/infrastructure/database/repositories.py`): - Add `session.commit()` to `create()`, `update()`, and `delete()` methods - Add `finally: session.close()` guard to all three methods - Update class docstring to reflect commit-per-method pattern **Tests & benchmarks**: - 3 Behave BDD regression scenarios (`features/project_show_after_create.feature`) - Robot Framework integration smoke tests with "not found" assertion (`robot/project_show_after_create.robot`) - ASV benchmarks for create-then-show round-trip (`benchmarks/project_show_after_create_bench.py`) ## Review feedback addressed - **F1**: Removed unrelated em-dash CHANGELOG edits — wrote clean entry from scratch - **F2**: Kept Suite Setup/Teardown (required for `${PYTHON}` variable); updated stale docs - **F3**: Added "not found" string assertion to Robot negative test case - **F4**: Removed redundant `Base.metadata.create_all()` from `_make_fresh_repo()` helper - Updated all stale TDD "expected to fail" comments — this PR includes the fix ## Process - Single squashed commit, rebased onto `master` (no merge commits) - Prescribed commit message from issue #590 metadata ISSUES CLOSED: #590 Reviewed-on: #593 Reviewed-by: Rui Hu <rui.hu@cleverthis.com> Co-authored-by: Brent E. Edwards <brent.edwards@cleverthis.com> Co-committed-by: Brent E. Edwards <brent.edwards@cleverthis.com> |
||
|
|
26de6bb7de |
fix(project): persist project to database during creation (#591)
CI / lint (push) Successful in 15s
CI / build (push) Successful in 17s
CI / quality (push) Successful in 18s
CI / typecheck (push) Successful in 38s
CI / benchmark-regression (push) Has been skipped
CI / security (push) Successful in 50s
CI / unit_tests (push) Successful in 2m13s
CI / docker (push) Successful in 41s
CI / integration_tests (push) Successful in 3m11s
CI / coverage (push) Successful in 4m30s
CI / benchmark-publish (push) Successful in 16m39s
## Summary
Fix `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` invocations that open a separate session.
## Changes
**Production fix** (`src/cleveragents/infrastructure/database/repositories.py`):
- Replace `session.flush()` with `session.commit()` in `NamespacedProjectRepository.create()`
- Add `finally: session.close()` guard for proper session lifecycle
**Tests & benchmarks**:
- 4 Behave BDD regression scenarios (`features/project_create_persist.feature`)
- Robot Framework integration smoke tests (`robot/project_create_persist.robot`)
- ASV benchmarks for create-then-list round-trip (`benchmarks/project_create_persist_bench.py`)
## Review feedback addressed
- **H3**: Added `finally: session.close()` to `create()` method
- **M1**: Removed redundant `session.flush()` before `session.commit()`
- **M2**: Updated stale TDD "expected to fail" comments — this PR includes the fix
- **M4**: Rewrote CHANGELOG entry to describe the fix, not just tests
- **F1**: Updated Robot documentation (Suite Setup/Teardown kept — needed for `${PYTHON}`)
- **F2**: Fixed bare assertion `"my-app"` to `"local/my-app"` in namespace scenario
- **F3**: Removed redundant `Base.metadata.create_all()` from `_make_fresh_repo()`
## Process
- Single squashed commit, rebased onto `master` (no merge commits)
- Prescribed commit message from issue #589 metadata
ISSUES CLOSED: #589
Reviewed-on: #591
Reviewed-by: Rui Hu <rui.hu@cleverthis.com>
Co-authored-by: Brent E. Edwards <brent.edwards@cleverthis.com>
Co-committed-by: Brent E. Edwards <brent.edwards@cleverthis.com>
|
||
|
|
583e6b7ea2
|
feat(correcting-plans): implement Predictive Error Prevention (Layer 4) with Error Pattern Database
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 14s
CI / build (pull_request) Successful in 16s
CI / quality (pull_request) Successful in 17s
CI / security (pull_request) Successful in 36s
CI / typecheck (pull_request) Successful in 54s
CI / unit_tests (pull_request) Successful in 2m39s
CI / integration_tests (pull_request) Successful in 3m10s
CI / docker (pull_request) Successful in 40s
CI / coverage (pull_request) Successful in 5m0s
CI / lint (push) Successful in 14s
CI / build (push) Successful in 15s
CI / quality (push) Successful in 16s
CI / security (push) Successful in 34s
CI / typecheck (push) Successful in 35s
CI / benchmark-regression (push) Has been skipped
CI / unit_tests (push) Successful in 2m23s
CI / docker (push) Successful in 38s
CI / integration_tests (push) Successful in 3m8s
CI / coverage (push) Successful in 5m10s
CI / benchmark-publish (push) Successful in 16m26s
CI / benchmark-regression (pull_request) Successful in 30m12s
Implement spec-mandated Layer 4 Predictive Error Prevention system: - ErrorPattern domain model with pattern text, historical failures, preventive checks, frequency tracking, and keyword-based matching. - ErrorPatternRepository with in-memory CRUD + context-matching query. - ErrorPatternService with record_failure(), match_patterns(), and get_statistics() methods. - Wire into plan execution via plan_lifecycle_service pre-execution hook. - Add error pattern statistics to CLI diagnostics output. Behave BDD: 11 scenarios covering recording, matching, formatting, stats. Robot Framework: 3 integration smoke tests. ASV benchmarks: pattern matching performance. ISSUES CLOSED: #571 |
||
|
|
61fc70d84b |
fix(cli): pass decision tree and influence edges to CorrectionService in plan correct handler (#639)
CI / lint (push) Successful in 15s
CI / build (push) Successful in 18s
CI / quality (push) Successful in 18s
CI / security (push) Successful in 35s
CI / typecheck (push) Successful in 37s
CI / benchmark-regression (push) Has been skipped
CI / unit_tests (push) Successful in 2m11s
CI / docker (push) Successful in 42s
CI / integration_tests (push) Successful in 3m12s
CI / coverage (push) Successful in 4m40s
CI / benchmark-publish (push) Successful in 16m46s
## Summary Fixes the `plan correct` CLI handler which never passes the decision tree or influence edges to `CorrectionService`, producing single-node impact analysis regardless of the plan's actual decision structure. Closes #606 ## Root Cause The `correct_decision()` handler in `plan.py` created a bare `CorrectionService()` and called `analyze_impact()` and `execute_correction()` without passing `decision_tree` or `influence_edges`. Both parameters default to `None` -> empty dicts, causing `_compute_affected_subtree()` BFS to return only the single target decision, ignoring all descendants and influence-DAG dependents. ## Changes ### Production Fix (`src/cleveragents/cli/commands/plan.py`) - Resolve `DecisionService` via `get_container()` (following the pattern used by `plan explain` and `plan tree`) - Build structural tree adjacency list from `decision_svc.list_decisions(plan_id)` using `parent_decision_id` relationships - Fetch influence edges from `decision_svc.get_influence_edges(plan_id)` - Pass both `decision_tree` and `influence_edges` to `svc.analyze_impact()` and `svc.execute_correction()` ### Existing Test Fixups - Updated 4 step definition files that mock `CorrectionService` to also mock the new `DecisionService` resolution path ### New Tests - **Behave BDD**: 3 scenarios verifying tree/edge forwarding (dry-run subtree, execution subtree, leaf node) - **Robot Framework**: 3 integration smoke tests - **ASV Benchmark**: Tree building and analyze_impact overhead benchmarks ## Quality Gates - `nox -s lint` — PASSED - `nox -s typecheck` — 0 errors - `nox -s unit_tests` — 9,109 scenarios, 0 failures - `nox -s coverage_report` — 97% ISSUES CLOSED: #606 Reviewed-on: #639 Co-authored-by: Jeffrey Phillips Freeman <jeffrey.freeman@cleverthis.com> Co-committed-by: Jeffrey Phillips Freeman <jeffrey.freeman@cleverthis.com> |
||
|
|
a44082ab70 |
feat(guardrails): implement Plan Generation Pre-flight Guardrails (7 checks before execution)
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 15s
CI / build (pull_request) Successful in 17s
CI / quality (pull_request) Successful in 20s
CI / security (pull_request) Successful in 34s
CI / typecheck (pull_request) Successful in 36s
CI / unit_tests (pull_request) Successful in 2m8s
CI / docker (pull_request) Successful in 38s
CI / integration_tests (pull_request) Successful in 3m8s
CI / coverage (pull_request) Successful in 4m43s
CI / quality (push) Successful in 17s
CI / lint (push) Successful in 21s
CI / build (push) Successful in 24s
CI / security (push) Successful in 54s
CI / typecheck (push) Successful in 1m13s
CI / benchmark-regression (push) Has been skipped
CI / unit_tests (push) Successful in 2m25s
CI / docker (push) Successful in 39s
CI / integration_tests (push) Successful in 3m38s
CI / coverage (push) Successful in 4m32s
CI / benchmark-publish (push) Successful in 16m58s
CI / benchmark-regression (pull_request) Successful in 29m51s
Implement spec-mandated pre-flight guardrail checks that validate plan readiness before entering the Strategize phase: 1. Action schema validation — verifies action exists and is well-formed. 2. Actor availability — confirms all 4 actor roles registered. 3. Skill/tool existence — transitively resolves all tools/skills. 4. Automation policy — verifies profile permits execution. 5. Rollback feasibility — ensures all tools checkpointable if required. 6. Resource accessibility — shallow connectivity check on linked resources. 7. Validation attachment resolution — pre-resolves all applicable validations. PlanPreflightGuardrail service runs all 7 checks via run_all_checks(). On first failure, raises PreflightRejection with check name and message. Wired into plan_lifecycle_service before Strategize phase. Behave BDD: 18 scenarios covering all 7 checks (positive + negative). Robot Framework: 3 integration smoke tests. ASV benchmarks: pre-flight check execution time. ISSUES CLOSED: #582 |
||
|
|
7b1020e735 |
feat(security): implement Prompt Injection Mitigation (5 mechanisms)
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 15s
CI / build (pull_request) Successful in 16s
CI / quality (pull_request) Successful in 18s
CI / typecheck (pull_request) Successful in 36s
CI / security (pull_request) Successful in 36s
CI / unit_tests (pull_request) Successful in 3m46s
CI / docker (pull_request) Successful in 39s
CI / integration_tests (pull_request) Successful in 4m30s
CI / coverage (pull_request) Successful in 4m35s
CI / lint (push) Successful in 12s
CI / build (push) Successful in 16s
CI / quality (push) Successful in 16s
CI / security (push) Successful in 33s
CI / typecheck (push) Successful in 35s
CI / benchmark-regression (push) Has been skipped
CI / unit_tests (push) Successful in 2m7s
CI / docker (push) Successful in 39s
CI / integration_tests (push) Successful in 3m4s
CI / coverage (push) Successful in 4m35s
CI / benchmark-publish (push) Has been cancelled
CI / benchmark-regression (pull_request) Successful in 29m37s
Implement spec-mandated prompt injection protections: 1. Input sanitization (PromptSanitizer.sanitize_user_input): escapes HTML entities, strips C0/C1 control characters, rejects 8 known injection patterns including instruction override, role assumption, ChatML tags, and boundary marker spoofing. 2. Prompt boundary markers (PromptSanitizer.wrap_user_content): wraps user content with [USER_CONTENT_START]/[USER_CONTENT_END] markers; augment_system_prompt() prepends boundary recognition instructions. 3. Output validation: existing schema_validator.py validates tool I/O against JSON Schema in ToolRuntime.execute() (verified, tested). 4. Tool capability restrictions: existing _enforce_capabilities() in lifecycle.py enforces read_only/writes/checkpointable/side_effects declarations (verified, tested). 5. Unsafe tool gating: existing _enforce_capabilities() blocks unsafe tools unless allow_unsafe_tools=true in automation profile (verified, tested). Integrates sanitizer into session prompt construction, invariant text processing, and action argument handling paths. ISSUES CLOSED: #572 |
||
|
|
d3cc7d30d7 |
fix(tool): persist tool registration to database after add
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 15s
CI / build (pull_request) Successful in 16s
CI / quality (pull_request) Successful in 19s
CI / security (pull_request) Successful in 34s
CI / typecheck (pull_request) Successful in 36s
CI / unit_tests (pull_request) Successful in 3m45s
CI / docker (pull_request) Successful in 40s
CI / integration_tests (pull_request) Successful in 4m34s
CI / coverage (pull_request) Successful in 4m39s
CI / lint (push) Successful in 12s
CI / build (push) Successful in 15s
CI / quality (push) Successful in 17s
CI / security (push) Successful in 33s
CI / typecheck (push) Successful in 34s
CI / benchmark-regression (push) Has been skipped
CI / unit_tests (push) Successful in 2m21s
CI / integration_tests (push) Successful in 3m9s
CI / docker (push) Successful in 1m0s
CI / coverage (push) Successful in 4m37s
CI / benchmark-publish (push) Has been cancelled
CI / benchmark-regression (pull_request) Successful in 30m5s
ToolRegistryRepository.create(), .update(), and .delete() called session.flush() but never session.commit(). The CLI factory creates a raw sessionmaker without a UnitOfWork wrapper, so the transaction was never committed and SQLAlchemy performed an implicit rollback when the session was garbage-collected. The same bug existed in ValidationAttachmentRepository.attach() and .detach(). Changes: - Add session.commit() after session.flush() in all five mutating methods across ToolRegistryRepository and ValidationAttachmentRepository. - Add finally: session.close() to guarantee session cleanup regardless of success or failure. - Update class docstrings to reflect the new commit-on-write semantics. - Add Behave BDD feature (tool_add_persist.feature) with scenarios for single-tool round-trip, multi-tool persistence, and duplicate rejection, using file-based SQLite to reproduce the cross-session issue. - Add Robot Framework integration test (tool_add_persist.robot) with add-then-list and fresh-list-empty scenarios. - Add ASV benchmark (tool_add_persist_bench.py) with track_list_after_add_count metric. Key decisions: - File-based SQLite (not in-memory) is used in tests because the bug only manifests when the session/engine is fully disposed between add and list, simulating separate CLI invocations. - Step patterns are prefixed with "tool-persist" to avoid AmbiguousStep collisions with existing tool_registry_steps.py. - The commit-in-repository approach was chosen over adding a UnitOfWork to the CLI factory because the CLI commands are simple CRUD operations that should auto-persist without requiring callers to remember to commit. ISSUES CLOSED: #621 |
||
|
|
9704281bdd |
fix(skill): persist skill registration to database after add
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 15s
CI / quality (pull_request) Successful in 19s
CI / build (pull_request) Successful in 19s
CI / security (pull_request) Successful in 36s
CI / typecheck (pull_request) Successful in 39s
CI / unit_tests (pull_request) Successful in 2m29s
CI / docker (pull_request) Successful in 41s
CI / integration_tests (pull_request) Successful in 3m14s
CI / coverage (pull_request) Successful in 4m26s
CI / benchmark-regression (pull_request) Successful in 30m9s
CI / lint (push) Successful in 14s
CI / build (push) Successful in 16s
CI / quality (push) Successful in 17s
CI / security (push) Successful in 33s
CI / typecheck (push) Successful in 34s
CI / benchmark-regression (push) Has been skipped
CI / unit_tests (push) Successful in 2m18s
CI / docker (push) Successful in 39s
CI / integration_tests (push) Successful in 3m7s
CI / coverage (push) Successful in 4m29s
CI / benchmark-publish (push) Has been cancelled
Wire SkillService to use SkillRepository for database persistence, fixing the bug where `agents skill add` stored skills only in an in-memory OrderedDict that was lost when the CLI process exited. Changes: - SkillService now accepts optional skill_repo and session_factory parameters. When provided, add_skill() persists to the database and the constructor pre-loads existing skills from DB rows. - _get_skill_service() in the CLI now creates a DB-backed service following the same engine/sessionmaker/repository pattern used by the tool CLI (tool.py). - _reset_skill_service() now installs a fresh in-memory SkillService (instead of setting None) to avoid DB side-effects during unit testing with parallel runners. - remove_skill() also persists the deletion to the database. Test coverage: - Behave BDD: features/skill_add_persist.feature (4 scenarios) - Robot Framework: robot/skill_add_persist.robot (3 smoke tests) - ASV benchmark: benchmarks/skill_add_persist_bench.py ISSUES CLOSED: #620 |
||
|
|
a4ac36cd50
|
Docs: Daily update to timeline
CI / lint (push) Successful in 1m10s
CI / build (push) Successful in 1m10s
CI / quality (push) Successful in 1m12s
CI / security (push) Successful in 1m28s
CI / typecheck (push) Successful in 1m48s
CI / benchmark-regression (push) Has been skipped
CI / unit_tests (push) Successful in 3m17s
CI / docker (push) Successful in 39s
CI / integration_tests (push) Successful in 4m1s
CI / coverage (push) Successful in 4m30s
CI / benchmark-publish (push) Successful in 17m5s
|
||
|
|
ca4621f9ec |
Docs: Updated CONTRIBUTING.md to reflect new TDD bug workflow
CI / build (push) Successful in 16s
CI / quality (push) Successful in 55s
CI / security (push) Successful in 1m11s
CI / typecheck (push) Successful in 1m15s
CI / lint (push) Successful in 3m7s
CI / benchmark-regression (push) Has been skipped
CI / unit_tests (push) Successful in 3m34s
CI / integration_tests (push) Successful in 3m52s
CI / docker (push) Successful in 40s
CI / coverage (push) Successful in 4m28s
CI / benchmark-publish (push) Successful in 16m57s
|
||
|
|
64cfdc782a |
fix(resource): call bootstrap_builtin_types during initialization
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 15s
CI / build (pull_request) Successful in 16s
CI / quality (pull_request) Successful in 18s
CI / security (pull_request) Successful in 34s
CI / typecheck (pull_request) Successful in 51s
CI / unit_tests (pull_request) Successful in 2m20s
CI / docker (pull_request) Successful in 38s
CI / integration_tests (pull_request) Successful in 3m12s
CI / coverage (pull_request) Successful in 4m30s
CI / lint (push) Successful in 13s
CI / quality (push) Successful in 16s
CI / build (push) Successful in 15s
CI / security (push) Successful in 32s
CI / typecheck (push) Successful in 34s
CI / benchmark-regression (push) Has been skipped
CI / unit_tests (push) Successful in 3m45s
CI / docker (push) Successful in 41s
CI / integration_tests (push) Successful in 4m34s
CI / coverage (push) Successful in 4m36s
CI / benchmark-publish (push) Successful in 16m13s
CI / benchmark-regression (pull_request) Successful in 28m59s
Add a call to bootstrap_builtin_types() in init_command() (project.py) immediately after initialize_project() returns. This seeds the built-in resource types (fs-directory, git-checkout, etc.) into the database so that "resource add" commands succeed without "Resource type not found" errors. The call is idempotent — invoking it multiple times will not create duplicate types. Also fix the TDD robot test (resource_type_bootstrap_git.robot) to initialize a project before running "resource add", and fix a pre-existing parallel test failure in plan_commands_new_coverage where unittest.mock.patch could not reliably intercept PlanApplyService under behave-parallel fork() workers. ISSUES CLOSED: #523, #524 |
||
|
|
709f65a6fd |
test(resource): add failing tests for built-in git-checkout type bootstrap
Add TDD-style failing tests that verify the built-in git-checkout resource type is available after initialization. Tests assert the correct expected behavior: after agents init, the git-checkout type should exist in the registry and 'agents resource add git-checkout' should succeed. Tests are expected to fail until bug #524 is fixed, because bootstrap_builtin_types() is never called during initialization. The fix branch should be based on this branch so the fix commit inherits these tests. Files added: - features/resource_type_bootstrap_git.feature (2 Behave scenarios) - features/steps/resource_type_bootstrap_git_steps.py (step definitions) - robot/resource_type_bootstrap_git.robot (Robot Framework smoke test) ISSUES CLOSED: #553 |
||
|
|
f6d27de1cd
|
feat(extensibility): implement pluggable scope chain resolution
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 15s
CI / build (pull_request) Successful in 15s
CI / quality (pull_request) Successful in 18s
CI / security (pull_request) Successful in 34s
CI / typecheck (pull_request) Successful in 36s
CI / unit_tests (pull_request) Successful in 2m30s
CI / integration_tests (pull_request) Successful in 3m6s
CI / docker (pull_request) Successful in 40s
CI / coverage (pull_request) Successful in 4m28s
CI / benchmark-regression (pull_request) Successful in 29m56s
CI / lint (push) Successful in 13s
CI / quality (push) Successful in 20s
CI / build (push) Successful in 21s
CI / security (push) Successful in 32s
CI / typecheck (push) Successful in 34s
CI / benchmark-regression (push) Has been skipped
CI / unit_tests (push) Successful in 2m38s
CI / integration_tests (push) Successful in 3m12s
CI / docker (push) Successful in 40s
CI / coverage (push) Successful in 4m27s
CI / benchmark-publish (push) Successful in 16m51s
Introduce ComponentResolver with a deterministic 3-level scope chain (plan > project > global) for resolving pluggable Protocol-based components. The resolver supports caching, thread-safety, config.toml extension loading, plan metadata loading, introspection APIs, and security-restricted dynamic imports. Includes 39 BDD scenarios, 9 Robot Framework integration tests, ASV benchmarks, and vulture whitelist updates. 100% code coverage on component_resolver.py; overall coverage at 97.07%. ISSUES CLOSED: #552 |
||
|
|
620adfee01 |
fix(cli): add --yes flag to agents init for non-interactive setup
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 14s
CI / build (pull_request) Successful in 15s
CI / quality (pull_request) Successful in 25s
CI / security (pull_request) Successful in 35s
CI / typecheck (pull_request) Successful in 55s
CI / unit_tests (pull_request) Successful in 2m24s
CI / docker (pull_request) Successful in 38s
CI / integration_tests (pull_request) Successful in 3m16s
CI / coverage (pull_request) Successful in 4m30s
CI / benchmark-regression (pull_request) Successful in 32m6s
CI / lint (push) Successful in 12s
CI / build (push) Successful in 15s
CI / quality (push) Successful in 17s
CI / security (push) Successful in 33s
CI / typecheck (push) Successful in 34s
CI / benchmark-regression (push) Has been skipped
CI / unit_tests (push) Successful in 2m19s
CI / docker (push) Successful in 38s
CI / integration_tests (push) Successful in 3m48s
CI / coverage (push) Successful in 5m48s
CI / benchmark-publish (push) Successful in 16m27s
Added --yes/-y flag to the agents init CLI command to support non-interactive initialization as specified in the documentation. When --yes is passed, all interactive prompts are skipped and default values are applied. The command produces the expected initialization summary output including data directory, config file, database, and created directories. The flag was added to both the top-level "agents init" command in main.py and the "agents project init" subcommand in project.py. Both delegate to the shared init_command() function which now accepts a yes parameter and produces spec-aligned Rich panel output (Data Dir, Config, Database, Directories) with the "Initialized (non-interactive)" status message when yes=True. When yes=False (default), existing interactive behavior is preserved unchanged. ISSUES CLOSED: #522 |
||
|
|
4221582368 |
feat(acms): implement pipeline Phase 3 components
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 14s
CI / build (pull_request) Successful in 15s
CI / quality (pull_request) Successful in 19s
CI / security (pull_request) Successful in 34s
CI / typecheck (pull_request) Successful in 36s
CI / unit_tests (pull_request) Successful in 2m28s
CI / docker (pull_request) Successful in 38s
CI / integration_tests (pull_request) Successful in 3m11s
CI / coverage (pull_request) Successful in 4m27s
CI / lint (push) Successful in 13s
CI / build (push) Successful in 15s
CI / quality (push) Successful in 16s
CI / security (push) Successful in 33s
CI / typecheck (push) Successful in 34s
CI / benchmark-regression (push) Has been skipped
CI / unit_tests (push) Successful in 2m21s
CI / docker (push) Successful in 42s
CI / integration_tests (push) Successful in 3m12s
CI / coverage (push) Successful in 5m6s
CI / benchmark-publish (push) Successful in 17m3s
CI / benchmark-regression (pull_request) Successful in 31m31s
Implemented the remaining ACMS pipeline components and advanced context strategies: Pipeline Phase 3: - FragmentOrdererProtocol + RelevanceCoherenceOrderer: orders fragments by relevance while maintaining narrative coherence via UKO node prefix grouping. Groups related fragments together, sorts groups by max relevance, and within groups orders by relevance desc / depth asc. - PreambleGeneratorProtocol + ProvenancePreambleGenerator: generates provenance preamble with strategy contributions (fragment counts and token percentages), confidence indicators (avg/min/max), tier and depth distribution, UKO node coverage, and coverage gap detection. Advanced Strategies: - ArceStrategy (quality 0.95): adaptive recursive context expansion with iterative multi-backend refinement and configurable iteration limit (default 5) to prevent unbounded refinement. Uses composite scoring (relevance + depth + diversity) with contextual boosting for fragments related to the current top-ranked anchor set. - TemporalArchaeologyStrategy (quality 0.5): historical context retrieval from graph+cold backends. Prioritises cold-tier fragments using a temporal scoring model (tier bonus + relevance + depth). - PlanDecisionContextStrategy (quality 0.7): decision history retrieval from warm/cold backends. Prioritises warm then cold tier fragments for correction and retry scenarios. All strategies registered in strategy registry with correct quality scores and backend requirements. All components implement their respective Protocol interfaces and can be injected into the ContextAssemblyPipeline via constructor dependency injection. Tests: - 33 BDD scenarios in features/acms_pipeline_phase3.feature - Robot Framework integration tests in robot/acms_pipeline_phase3.robot - ASV performance benchmarks in benchmarks/acms_pipeline_phase3_bench.py ISSUES CLOSED: #545 |
||
|
|
272f907851 |
Merge pull request 'test(resource): add failing tests for built-in git-checkout type bootstrap (#524)' (#568) from feature/m3-test-resource-bootstrap-git into master
CI / lint (push) Successful in 15s
CI / build (push) Successful in 17s
CI / quality (push) Successful in 17s
CI / security (push) Successful in 34s
CI / typecheck (push) Successful in 37s
CI / benchmark-regression (push) Has been skipped
CI / unit_tests (push) Successful in 2m24s
CI / docker (push) Successful in 46s
CI / integration_tests (push) Successful in 3m13s
CI / coverage (push) Successful in 4m29s
CI / benchmark-publish (push) Successful in 16m59s
Reviewed-on: #568 Reviewed-by: Hamza Khyari <hamza.khyari@cleverthis.com> |