93e3893d69
CI / lint (pull_request) Successful in 14s
CI / typecheck (pull_request) Successful in 34s
CI / security (pull_request) Successful in 29s
CI / quality (pull_request) Successful in 15s
CI / benchmark-publish (pull_request) Has been skipped
CI / build (pull_request) Successful in 14s
CI / unit_tests (pull_request) Successful in 2m4s
CI / integration_tests (pull_request) Successful in 2m50s
CI / coverage (pull_request) Successful in 4m15s
CI / docker (pull_request) Successful in 42s
CI / lint (push) Successful in 12s
CI / typecheck (push) Successful in 31s
CI / quality (push) Successful in 16s
CI / security (push) Successful in 31s
CI / build (push) Successful in 16s
CI / unit_tests (push) Successful in 3m23s
CI / benchmark-regression (push) Has been skipped
CI / docker (push) Successful in 42s
CI / integration_tests (push) Successful in 4m11s
CI / coverage (push) Successful in 4m8s
CI / benchmark-publish (push) Successful in 16m5s
CI / benchmark-regression (pull_request) Successful in 29m59s
Implement the runtime execution engine for validation tool wrapping, as specified in docs/specification.md § Tool Wrapping. WrappedToolExecutor resolves wraps references and delegates execution to wrapped tools, supporting composable wrapping chains with cycle detection and depth limiting (max 10 levels). ArgumentMapper translates arguments between wrapper and wrapped tool schemas using the argument_mapping configuration. Supports both forwarded parameter names and literal fixed values. TransformExecutor runs user-supplied transform functions in a sandboxed Python environment with restricted builtins (no imports, no filesystem, no network access). Validates that transforms return proper validation-format dicts with a passed boolean. Wired into the tool package public API via tool/__init__.py exports. All new error types (WrappedToolNotFoundError, WrappingCycleError, WrappingDepthExceededError, TransformExecutionError) provide clear diagnostic messages. Tests: 20 Behave scenarios covering argument mapping, transform execution, simple/chained delegation, error handling, and sandbox restrictions. 8 Robot Framework integration smoke tests. ASV benchmarks for delegation overhead measurement. ISSUES CLOSED: #543
9 lines
268 B
Python
9 lines
268 B
Python
"""Robot helper: verify ArgumentMapper translates arguments."""
|
|
|
|
from cleveragents.tool.wrapping import ArgumentMapper
|
|
|
|
m = ArgumentMapper({"dest": "src", "flag": True})
|
|
r = m.apply({"src": "/path"})
|
|
assert r == {"dest": "/path", "flag": True}, f"Got {r}"
|
|
print("OK")
|