Files
CoreRasurae 9753b31c7e
CI / quality (push) Successful in 36s
CI / lint (push) Successful in 38s
CI / typecheck (push) Successful in 49s
CI / security (push) Successful in 51s
CI / integration_tests (push) Successful in 55s
CI / unit_tests (push) Successful in 3m35s
CI / build (push) Successful in 33s
CI / coverage (push) Successful in 3m36s
CI / status-check (push) Successful in 3s
test: add coverage gap tests improving coverage from 81.4% to 96.90%
Add 13 BDD scenarios covering previously uncovered code paths:
- SAFE_BUILTINS validation (sandbox.py: 0% → 100%)
- ConfigurationError re-raise path (config.py: 99.3% → 100%)
- CLI hello/main functions (cli.py: 72.7% → 90.9%)
- GraphState message truncation (state.py: 98.7% → 100%)
- ProgressBarManager update/context rendering (progress.py: 0% → 87.7%)
- MessageRouter regex/exact/contains routing (message_router.py: 0% → 59.4%)
- RoutingAdapter parse_routing_command (routing_adapter.py)
- DynamicRouterNode pattern-based routing (dynamic_router.py)
- EnhancedTemplateRegistry unknown template type (enhanced_registry.py: 99.2%)
- CompositeAgent null-graph error path (composite.py: 97.8% → 98.6%)

Cover routing_adapter.py (17% → 100%): all GOTO/ROUTE patterns,
create_routing_node, create_conditional_router, dynamic config conversion.

Cover dynamic_router.py (21% → 87%): execute with empty/dict/string
messages, extract_message with colon parsing, config creation, graph
extension with edge generation.

Cover message_router.py (59% → 78%): regex, exact, contains, prefix,
suffix match types, invalid regex handling, non-string message, set_state.

Exercise Node._prepare_conversation_history with invalid configs,
_runtime error paths, _execute_message_router with rules,
_execute_agent with current_message and metadata propagation,
_execute_function with dynamic_router, and _execute_conditional
with content_contains/content_not_contains/content_starts_with
and custom condition types. Improves nodes.py from 71.3% to 72.5%.

Exercise PureGraphConfig, PureLangGraph init with dict/config,
RxPyLangGraphBridge registration/connection/lookup,
ReactiveStreamRouter operator creation and condition functions,
ReactiveConfigParser config/route/graph parsing,
ToolAgent tool execution with JSON, space-separated, single,
file_read, progress_bar invocations, and
ReactiveCleverAgentsApp init/dispose/visualization.
2026-06-02 20:02:01 +01:00

92 lines
4.5 KiB
Gherkin

Feature: SAFE_BUILTINS, ConfigurationError Propagation, CLI Execution, and Message Routing
As a developer
I want SAFE_BUILTINS to contain only safe builtins, ConfigurationError to propagate correctly, CLI commands to execute, and message routers to work with regex and exact match rules
So that sandbox safety is enforced, config errors are not swallowed, and routing utilities function correctly
Scenario: SAFE_BUILTINS should contain all required builtins and exclude dangerous ones
Given I have a clean gap coverage test environment
Given the sandbox module is importable
Then SAFE_BUILTINS should contain all whitelisted builtins
And SAFE_BUILTINS should not contain dangerous builtins
Scenario: ConfigurationError re-raise path during validation
Given I have a clean gap coverage test environment
Given I create a ConfigurationManager instance
Given I load a config that triggers a schema ConfigurationError
Then the ConfigurationError should propagate without wrapping during validation
Scenario: CLI hello command executes without error
Given I have a clean gap coverage test environment
When I invoke the cli hello command
Then the cli should execute without error
Scenario: CLI main function executes without error
Given I have a clean gap coverage test environment
When I invoke the cli main function
Then the cli should execute without error
Scenario: EnhancedTemplateRegistry raises ValueError for unknown template type
Given I have a clean gap coverage test environment
Given I have an EnhancedTemplateRegistry instance
When I register a simple template with an invalid template type
Then a ValueError should be raised for the unknown template type
Scenario: CompositeAgent raises ExecutionError for nonexistent graph
Given I have a clean gap coverage test environment
When I access the composite agent graph loading with a nonexistent graph name
Then an ExecutionError should be raised for the missing graph
Scenario: GraphState truncates messages in merge mode when exceeding 50
Given I have a clean gap coverage test environment
Given I create a GraphState with merge update mode
When I push more than 50 messages into the graph state
Then the graph state messages should be truncated to 50
Scenario: GraphState truncates messages in append mode when exceeding 50
Given I have a clean gap coverage test environment
Given I create a GraphState with append update mode
When I push more than 50 messages into the graph state
Then the graph state messages should be truncated to 50
Scenario: ProgressBarManager renders progress without error
Given I have a clean gap coverage test environment
Given I create a ProgressBarManager
When I call update with valid progress data
And I call update with context-derived data
And I call update multiple times to simulate progression
Then the progress bar should render without error
Scenario: MessageRouter routes messages with regex rules
Given I have a clean gap coverage test environment
Given I import the MessageRouter class
When I create a MessageRouter with custom regex rules
And I route a matching regex message
Then the regex rule should match and return the target
Scenario: MessageRouter routes messages with exact match rules
Given I have a clean gap coverage test environment
Given I import the MessageRouter class
When I create a MessageRouter with exact match rules
And I route a matching exact message
And I route a non-matching message
Then the exact rule should match
And the non-matching message should fall through
Scenario: RoutingAdapter parses routing commands
Given I have a clean gap coverage test environment
Given I import the RoutingAdapter class
When I create a RoutingAdapter
And I parse a valid routing command from message content
And I parse an invalid routing command
Then the routing adapter should extract routing information
And the invalid command should be handled gracefully
Scenario: DynamicRouter resolves routes based on conditions
Given I have a clean gap coverage test environment
Given I import the DynamicRouter class
When I create a DynamicRouter
And I add routes with conditions to the DynamicRouter
And I resolve a message through the DynamicRouter
And I resolve a non-matching message through the DynamicRouter
Then the DynamicRouter should route to the correct target
And the DynamicRouter should return unchanged for non-matching content