16 Commits

Author SHA1 Message Date
hurui200320 8dc55655e9 feat(actor): make built-in actors virtual, resolved on-demand from provider registry
CI / push-validation (push) Successful in 41s
CI / helm (push) Successful in 42s
CI / benchmark-publish (push) Failing after 56s
CI / build (push) Successful in 1m6s
CI / lint (push) Successful in 1m13s
CI / quality (push) Successful in 1m34s
CI / typecheck (push) Successful in 2m12s
CI / security (push) Successful in 2m13s
CI / e2e_tests (push) Successful in 3m45s
CI / integration_tests (push) Successful in 3m57s
CI / unit_tests (push) Successful in 4m53s
CI / docker (push) Successful in 1m34s
CI / coverage (push) Successful in 11m27s
CI / status-check (push) Successful in 3s
CI / benchmark-publish (pull_request) Has been skipped
CI / helm (pull_request) Successful in 32s
CI / push-validation (pull_request) Successful in 33s
CI / build (pull_request) Successful in 53s
CI / lint (pull_request) Successful in 59s
CI / quality (pull_request) Successful in 1m28s
CI / security (pull_request) Successful in 1m29s
CI / typecheck (pull_request) Successful in 1m32s
CI / e2e_tests (pull_request) Successful in 4m1s
CI / integration_tests (pull_request) Successful in 5m4s
CI / unit_tests (pull_request) Successful in 5m51s
CI / docker (pull_request) Successful in 1m27s
CI / coverage (pull_request) Successful in 11m51s
CI / status-check (pull_request) Successful in 3s
Replace the DB-persistence approach for built-in actors with in-memory virtual
resolution. Built-in actors (e.g. openai/gpt-4o, anthropic/claude-sonnet) are
now resolved on-demand from ProviderRegistry at query time and merged with
persisted custom actors — no database writes occur for built-in actors.

Key changes:
- Add ActorRegistry._resolve_virtual_builtin_actors(): generates virtual Actor
  objects in-memory from configured providers (is_built_in=True, id=None)
- ActorRegistry.list()/list_actors(): merges virtual built-ins with custom DB
  actors; custom actors win on name collision; result sorted alphabetically
- ActorRegistry.get()/get_actor(): DB-first, virtual built-in fallback,
  NotFoundError if neither
- ActorRegistry.remove()/remove_actor(): rejects virtual built-in names with
  ValidationError
- ActorRegistry.set_default_actor(): stores only the actor name string via new
  actor_preferences singleton table; no actor row created for virtual built-ins
- ActorRegistry.get_default_actor(): reads preference name, resolves via
  DB→virtual chain, returns actor with is_default=True
- Remove ensure_built_in_actors() entirely — 20+ call sites cleaned up including
  plan.py
- Remove ActorRepository.upsert_built_in() — no longer needed
- Remove is_built_in from ActorModel DB column (kept on Actor domain model for
  virtual actors)
- New Alembic migration m10_001_virtual_builtin_actors: drops is_built_in column,
  adds actor_preferences singleton table
- Add ActorService.set_default_actor_name() and get_default_actor_name() for
  preference storage without requiring a DB actor row
- Update 15+ Behave step files and 5 feature files; add new
  features/virtual_builtin_actors.feature with 8 scenarios covering list, show,
  remove, set-default, get-default, no-DB-writes guarantees
- Rewrite tests/actor/test_registry_builtin_yaml.py: TestEnsureBuiltInActorsWithYaml
  → TestResolveVirtualBuiltinActors plus new TestListActors, TestGetActor,
  TestRemoveActor, TestDefaultActor test classes

Quality gates: lint ✓, typecheck ✓, unit_tests ✓ (15674 scenarios), coverage ✓
(97.10%), integration_tests ✓ (1997 tests)

ISSUES CLOSED: #10923
2026-04-30 10:56:21 +00:00
freemo 62ded31c24 fix(cli): route 'agents actor add' through ActorRegistry.add() YAML-first path
CI / lint (pull_request) Failing after 29s
CI / unit_tests (pull_request) Failing after 2m2s
CI / helm (pull_request) Successful in 24s
CI / quality (pull_request) Successful in 3m42s
CI / typecheck (pull_request) Successful in 4m2s
CI / security (pull_request) Successful in 4m5s
CI / coverage (pull_request) Has been skipped
CI / docker (pull_request) Has been skipped
CI / build (pull_request) Successful in 3m16s
CI / e2e_tests (pull_request) Failing after 10m40s
CI / integration_tests (pull_request) Failing after 23m19s
CI / status-check (pull_request) Failing after 1s
CI / benchmark-publish (pull_request) Has been skipped
CI / benchmark-regression (pull_request) Has been skipped
Route the 'agents actor add' CLI command through ActorRegistry.add() instead
of the legacy registry.upsert_actor() path. This ensures the original YAML
text, schema_version, and compiled_metadata are preserved in the database.

Changes:
- src/cleveragents/cli/commands/actor.py: Add _load_config_text() helper that
  returns both raw text and parsed dict. Refactor add() to call registry.add()
  with the raw yaml_text and update=update_existing flag when a registry is
  available. The service fallback path (no registry) is unchanged.
- features/steps/actor_cli_steps.py: Update add command step definitions to
  mock registry.add() instead of registry.upsert_actor(). Update 'the actor
  add should pass the loaded config' assertion to verify registry.add() is
  called with a non-empty yaml_text string.
- features/steps/actor_cli_yaml_steps.py: Update add command steps to mock
  registry.add() instead of registry.upsert_actor().
- features/steps/actor_add_rich_output_steps.py: Update add command steps to
  mock registry.add() instead of registry.upsert_actor().
- robot/helper_actor_add_rich_output.py: Update helper to mock registry.add()
  instead of registry.upsert_actor().
- features/actor_add_yaml_first_path.feature: New Behave feature verifying
  the YAML-first persistence path is used by actor add.
- features/steps/actor_add_yaml_first_path_steps.py: Step definitions for
  the new YAML-first path feature.
- robot/actor_add_yaml_first_path.robot: New Robot integration tests verifying
  yaml_text is preserved and upsert_actor is not called.
- robot/helper_actor_add_yaml_first_path.py: Helper script for Robot tests.

Fixes #3426

ISSUES CLOSED: #3426
2026-04-05 21:19:40 +00:00
freemo eb4ccc819c fix(cli): add NAME positional argument to agents actor add command per spec
CI / lint (push) Waiting to run
CI / typecheck (push) Waiting to run
CI / security (push) Waiting to run
CI / quality (push) Waiting to run
CI / unit_tests (push) Waiting to run
CI / integration_tests (push) Waiting to run
CI / e2e_tests (push) Waiting to run
CI / coverage (push) Blocked by required conditions
CI / benchmark-regression (push) Blocked by required conditions
CI / benchmark-publish (push) Waiting to run
CI / build (push) Waiting to run
CI / docker (push) Blocked by required conditions
CI / helm (push) Waiting to run
CI / status-check (push) Blocked by required conditions
Reviewed and APPROVED. Closes #2905.
2026-04-05 21:09:13 +00:00
freemo a804506c89 fix(cli): compute real impact counts in agents actor remove command
CI / benchmark-publish (push) Waiting to run
CI / build (push) Waiting to run
CI / unit_tests (push) Waiting to run
CI / lint (push) Waiting to run
CI / typecheck (push) Waiting to run
CI / security (push) Waiting to run
CI / quality (push) Waiting to run
CI / integration_tests (push) Waiting to run
CI / e2e_tests (push) Waiting to run
CI / coverage (push) Blocked by required conditions
CI / benchmark-regression (push) Blocked by required conditions
CI / docker (push) Blocked by required conditions
CI / helm (push) Waiting to run
CI / status-check (push) Blocked by required conditions
Replaces hardcoded 0 values in the Impact panel of `agents actor remove` with real DB-backed counts for sessions, active plans, and actions referencing the removed actor.

ISSUES CLOSED: #3420

Co-authored-by: Jeffrey Phillips Freeman <the@jeffreyfreeman.me>
Co-committed-by: Jeffrey Phillips Freeman <the@jeffreyfreeman.me>
2026-04-05 18:18:08 +00:00
freemo 2d07cd5ef8 fix(cli): add NAME positional argument to agents actor add command per spec
CI / lint (pull_request) Successful in 28s
CI / typecheck (pull_request) Successful in 53s
CI / security (pull_request) Successful in 55s
CI / quality (pull_request) Successful in 34s
CI / build (pull_request) Successful in 17s
CI / helm (pull_request) Successful in 23s
CI / unit_tests (pull_request) Successful in 7m0s
CI / e2e_tests (pull_request) Failing after 16m33s
CI / integration_tests (pull_request) Successful in 23m25s
CI / docker (pull_request) Successful in 1m25s
CI / coverage (pull_request) Successful in 10m40s
CI / status-check (pull_request) Failing after 1s
CI / benchmark-publish (pull_request) Has been skipped
CI / benchmark-regression (pull_request) Successful in 58m9s
The spec (docs/reference/actor_cli.md) defines the synopsis for
`agents actor add` as:

  agents actor add <NAME> --config <FILE> [--update] [--unsafe]
  [--set-default] [--option key=value] [--format FORMAT]

The implementation was missing the required <NAME> positional argument,
silently reading the actor name from the config file's `name` field
instead. This deviates from the spec and breaks the expected CLI UX.

Changes:
- Add `name` as a required positional Argument to the `add` command
- Update docstring to match spec synopsis exactly
- The positional NAME takes precedence over any `name` field in config
- Remove the now-redundant config-file name validation (name comes from CLI)
- Add Behave BDD feature + steps for the NAME positional argument (TDD)
- Update all existing Behave step invocations to pass NAME positional arg
- Update Robot Framework helpers to pass NAME positional arg

ISSUES CLOSED: #2905
2026-04-05 08:12:32 +00:00
freemo a9465c4865 fix(cli): derive actor name from config file instead of positional argument
CI / benchmark-publish (pull_request) Has been skipped
CI / build (pull_request) Successful in 18s
CI / helm (pull_request) Successful in 22s
CI / typecheck (pull_request) Successful in 50s
CI / lint (pull_request) Successful in 3m19s
CI / quality (pull_request) Successful in 3m53s
CI / security (pull_request) Successful in 4m12s
CI / integration_tests (pull_request) Successful in 7m10s
CI / unit_tests (pull_request) Successful in 7m27s
CI / docker (pull_request) Successful in 1m30s
CI / coverage (pull_request) Successful in 11m54s
CI / e2e_tests (pull_request) Successful in 19m37s
CI / status-check (pull_request) Successful in 1s
CI / build (push) Successful in 15s
CI / helm (push) Successful in 23s
CI / security (push) Successful in 57s
CI / lint (push) Successful in 3m18s
CI / quality (push) Successful in 3m39s
CI / typecheck (push) Successful in 3m52s
CI / integration_tests (push) Successful in 8m48s
CI / unit_tests (push) Successful in 9m38s
CI / docker (push) Successful in 1m18s
CI / coverage (push) Successful in 11m48s
CI / e2e_tests (push) Successful in 20m13s
CI / status-check (push) Successful in 1s
CI / benchmark-publish (push) Successful in 28m20s
CI / benchmark-regression (push) Has been skipped
CI / benchmark-regression (pull_request) Successful in 54m52s
Remove the <NAME> positional argument from `actor add` command. The actor
name is now derived from the `name` field inside the config YAML file, per
the specification: `agents actor add (--config|-c) <FILE> [--update]`.
Updated all BDD and integration tests to pass name via config file.

ISSUES CLOSED: #914
2026-03-30 18:27:59 +00:00
brent.edwards c9605c9381 test(features/steps): remove ansi codes
CI / lint (pull_request) Successful in 17s
CI / security (pull_request) Successful in 17s
CI / typecheck (pull_request) Successful in 24s
CI / quality (pull_request) Successful in 15s
CI / build (pull_request) Successful in 13s
CI / behave (3.13) (pull_request) Successful in 3m43s
CI / docker (pull_request) Failing after 33s
CI / helm (pull_request) Failing after 6s
CI / coverage (pull_request) Successful in 4m20s
Remove rich formatting from output
2026-02-12 05:44:57 +00:00
brent.edwards d4a48caeec test(features/steps): fix features that depend on running as user not superuser
CI / lint (pull_request) Successful in 16s
CI / typecheck (pull_request) Successful in 25s
CI / security (pull_request) Successful in 16s
CI / quality (pull_request) Successful in 14s
CI / build (pull_request) Successful in 12s
CI / behave (3.13) (pull_request) Failing after 3m54s
CI / docker (pull_request) Has been skipped
CI / helm (pull_request) Has been skipped
CI / coverage (pull_request) Failing after 4m17s
2026-02-12 05:23:29 +00:00
brent.edwards 761db2518c test: harden code sandbox, add path traversal protection, and fix test mocks
CI / lint (pull_request) Failing after 3s
CI / typecheck (pull_request) Failing after 3s
CI / coverage (pull_request) Has been skipped
CI / quality (pull_request) Failing after 5s
CI / security (pull_request) Failing after 6s
CI / behave (3.11) (pull_request) Failing after 2s
CI / behave (3.12) (pull_request) Failing after 2s
CI / behave (3.13) (pull_request) Failing after 3s
CI / docker (pull_request) Has been skipped
CI / helm (pull_request) Has been skipped
CI / build (pull_request) Failing after 3s
2026-02-12 01:07:44 +00:00
brent.edwards 7ef5ebb695 feat: Add Q0: Pre-commit hooks setup.
This should automatically check for problems on build.
2026-02-10 16:04:17 +00:00
freemo 6886ee2383 tests: improved coverage to 97% 2026-02-08 11:33:30 -05:00
freemo d98d282f5f tests: fixed unit tests so they are now working 2026-02-05 09:56:08 -05:00
freemo bb25017773 Feat: Handle actor CLI option overrides 2025-12-24 14:04:34 -05:00
freemo 65ee1a2e96 Feat: Harden actor configuration handling with unsafe confirmations, graph descriptors, and actor-based plan coverage. 2025-12-23 20:57:14 -05:00
freemo 7430b6e743 Feat: Added basic scaffolding for actors 2025-12-23 17:12:16 -05:00
freemo 34a29d7cc8 Feat: Adding Actors support to database 2025-12-19 12:35:56 -05:00