Files
cleveragents-core/features/stream_router_new_branches.feature
CoreRasurae f2f7aa5dc9 feat(core): add v3 lifecycle models, automation levels, subplan support, and security hardening
Implement multiple Stage A/B/E/SEC milestones for the v3 lifecycle system:
- Stage A5.3+A5.4: Add LifecycleActionModel and LifecyclePlanModel SQLAlchemy
  models with to_domain()/from_domain() conversion methods
- Stage A5.6: Implement ActionRepository with full CRUD, namespace/state
  queries, referential integrity checks, and retry decorator
- Stage E1: Add subplan domain models (ExecutionMode, SubplanMergeStrategy,
  SubplanConfig, SubplanStatus, SubplanAttempt, SubplanFailureHandler) with
  computed properties on Plan (is_subplan, is_root_plan, depth, has_subplans)
- Stage A6: Add AutomationLevel enum (MANUAL, REVIEW_BEFORE_APPLY,
  FULL_AUTOMATION), settings integration, PlanLifecycleService auto-progression,
  pause/resume, and CLI commands (--automation-level, set-automation-level)
- Stage SEC1: Remove eval()/exec() from stream_router.py, replace with named
  operation and transform registries; code blocks and unregistered transforms
  now raise StreamRoutingError
- Add langchain-anthropic dependency
- Update BDD tests for security changes and relax ADR directory requirement
2026-02-12 20:19:42 +00:00

56 lines
2.5 KiB
Gherkin

Feature: Stream Router additional uncovered branches
As a developer
I want Behave scenarios that exercise uncovered stream_router branches
So that coverage increases for critical operator paths
Background:
Given the CleverAgents reactive system is available
Scenario: LangGraph operator uses bridge factory when available
Given a LangGraph bridge stub is registered on the stream router
When I build a graph_execute operator through the bridge
Then the bridge factory should be invoked and map data
Scenario: Map operator processes message through registered agent
Given a dummy agent is registered on the stream router
When I map a message using that agent
Then the agent-mapped content should be returned with metadata
Scenario: Filter operator passes matching condition
When I build a filter operator with equals condition
Then the filter should emit only matching values
Scenario: Transform operator rejects unregistered fn string
When I build a transform operator with an unregistered function string
Then I should get a stream routing error about unregistered transform
Scenario: Switch operator handles case operators pipeline
When I run a switch operator with a case operator pipeline
Then the switch case should apply its operators
Scenario: Switch operator routes to a target stream case
Given I have an existing target stream named "case_target"
When I run a switch operator that routes to that case target
Then the case target stream should receive the message
Scenario: Unknown operator raises routing error
When I build an operator with an unknown type
Then I should get a stream routing error about unknown operator
Scenario: Extract field transform returns requested value and fallback
When I apply an extract_field transform to different message types
Then the transform should return the field value or original message
Scenario: Evaluate condition supports equals and field branches
When I evaluate equals and field conditions
Then both condition checks should return true
Scenario: Append accumulator returns unchanged when accumulator is not a list
When I apply the append accumulator to a non-list accumulator
Then the accumulator should be returned unchanged
Scenario: Setup subscriptions skips missing sources and subscribes existing
Given I prepare stream config with existing and missing subscriptions
When I setup subscriptions for that config
Then only existing sources should be subscribed