Files
cleveragents-core/features/server_client_stubs.feature
freemo ec0b7631d0
CI / lint (push) Successful in 12s
CI / build (push) Successful in 15s
CI / quality (push) Successful in 23s
CI / typecheck (push) Successful in 36s
CI / benchmark-regression (push) Has been skipped
CI / security (push) Successful in 46s
CI / unit_tests (push) Successful in 3m3s
CI / integration_tests (push) Successful in 3m31s
CI / docker (push) Successful in 40s
CI / coverage (push) Successful in 5m34s
CI / benchmark-publish (push) Successful in 19m15s
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 13s
CI / build (pull_request) Successful in 14s
CI / quality (pull_request) Successful in 17s
CI / security (pull_request) Successful in 34s
CI / typecheck (pull_request) Has been cancelled
CI / unit_tests (pull_request) Has been cancelled
CI / coverage (pull_request) Has been cancelled
CI / benchmark-regression (pull_request) Has been cancelled
CI / integration_tests (pull_request) Has been cancelled
CI / docker (pull_request) Has been cancelled
refactor(a2a): rename ACP module and symbols to A2A standard
Renamed src/cleveragents/acp/ to src/cleveragents/a2a/ and all 13
Acp* classes to A2a* per ADR-047 (A2A Standard Adoption). Updated
all imports, structlog event names (acp.* → a2a.*), field names
(acp_version → a2a_version), and test references across the entire
codebase. This is a cosmetic rename only — no behavioral changes.

ISSUES CLOSED: #688
2026-03-12 14:38:57 +00:00

184 lines
8.8 KiB
Gherkin

@phase2 @a2a @server-stubs
Feature: Server Client Stubs and Connection Config
As a developer
I want protocol stubs for server communication
So that the server client interfaces are defined before implementation
# -----------------------------------------------------------------------
# ServerConnectionConfig validation
# -----------------------------------------------------------------------
Scenario: ServerConnectionConfig accepts valid HTTPS URL
When I create a ServerConnectionConfig with url "https://agents.example.com"
Then the config server_url should be "https://agents.example.com"
And the config namespace should be "default"
And the config tls_verify should be true
Scenario: ServerConnectionConfig accepts valid HTTP URL
When I create a ServerConnectionConfig with url "http://localhost:8080"
Then the config server_url should be "http://localhost:8080"
Scenario: ServerConnectionConfig accepts custom namespace
When I create a ServerConnectionConfig with url "https://agents.example.com" and namespace "my-team"
Then the config namespace should be "my-team"
Scenario: ServerConnectionConfig accepts auth_token_ref
When I create a ServerConnectionConfig with url "https://agents.example.com" and auth_token_ref "CLEVERAGENTS_SERVER_TOKEN"
Then the config auth_token_ref should be "CLEVERAGENTS_SERVER_TOKEN"
Scenario: ServerConnectionConfig rejects empty URL
When I try to create a ServerConnectionConfig with empty url
Then a server config validation error should be raised
Scenario: ServerConnectionConfig rejects non-HTTP URL
When I try to create a ServerConnectionConfig with url "ftp://agents.example.com"
Then a server config validation error should be raised
Scenario: ServerConnectionConfig rejects whitespace-only URL
When I try to create a ServerConnectionConfig with url " "
Then a server config validation error should be raised
Scenario: ServerConnectionConfig rejects empty namespace
When I try to create a ServerConnectionConfig with url "https://ok.com" and empty namespace
Then a server config validation error should be raised
Scenario: ServerConnectionConfig is frozen
When I create a ServerConnectionConfig with url "https://agents.example.com"
Then the config should be immutable
Scenario: ServerConnectionConfig tls_verify defaults to true
When I create a ServerConnectionConfig with url "https://agents.example.com"
Then the config tls_verify should be true
Scenario: ServerConnectionConfig with tls_verify false
When I create a ServerConnectionConfig with url "http://localhost:8080" and tls_verify false
Then the config tls_verify should be false
# -----------------------------------------------------------------------
# StubServerClient — all methods raise NotImplementedError
# -----------------------------------------------------------------------
Scenario: StubServerClient health_check raises NotImplementedError
Given a new StubServerClient
When I call health_check on the stub server client
Then a NotImplementedError should be raised with message containing "not yet implemented"
Scenario: StubServerClient get_version raises NotImplementedError
Given a new StubServerClient
When I call get_version on the stub server client
Then a NotImplementedError should be raised with message containing "not yet implemented"
# -----------------------------------------------------------------------
# StubRemoteExecutionClient — all methods raise NotImplementedError
# -----------------------------------------------------------------------
Scenario: StubRemoteExecutionClient execute_plan raises NotImplementedError
Given a new StubRemoteExecutionClient
When I call execute_plan with plan_id "PLAN001" on the stub execution client
Then a NotImplementedError should be raised with message containing "not yet implemented"
Scenario: StubRemoteExecutionClient get_plan_status raises NotImplementedError
Given a new StubRemoteExecutionClient
When I call get_plan_status with plan_id "PLAN001" on the stub execution client
Then a NotImplementedError should be raised with message containing "not yet implemented"
Scenario: StubRemoteExecutionClient cancel_plan raises NotImplementedError
Given a new StubRemoteExecutionClient
When I call cancel_plan with plan_id "PLAN001" on the stub execution client
Then a NotImplementedError should be raised with message containing "not yet implemented"
Scenario: StubRemoteExecutionClient rejects empty plan_id
Given a new StubRemoteExecutionClient
When I call execute_plan with empty plan_id on the stub execution client
Then a ValueError should be raised for empty plan_id
# -----------------------------------------------------------------------
# StubAuthClient — all methods raise NotImplementedError
# -----------------------------------------------------------------------
Scenario: StubAuthClient authenticate raises NotImplementedError
Given a new StubAuthClient
When I call authenticate with token "tok_test" on the stub auth client
Then a NotImplementedError should be raised with message containing "not yet implemented"
Scenario: StubAuthClient validate_token raises NotImplementedError
Given a new StubAuthClient
When I call validate_token with token "tok_test" on the stub auth client
Then a NotImplementedError should be raised with message containing "not yet implemented"
Scenario: StubAuthClient rejects empty token
Given a new StubAuthClient
When I call authenticate with empty token on the stub auth client
Then a ValueError should be raised for empty token
# -----------------------------------------------------------------------
# Protocol conformance
# -----------------------------------------------------------------------
Scenario: StubServerClient conforms to ServerClient protocol
Then StubServerClient should be a runtime instance of ServerClient
Scenario: StubRemoteExecutionClient conforms to RemoteExecutionClient protocol
Then StubRemoteExecutionClient should be a runtime instance of RemoteExecutionClient
Scenario: StubAuthClient conforms to AuthClient protocol
Then StubAuthClient should be a runtime instance of AuthClient
# -----------------------------------------------------------------------
# Config keys registration
# -----------------------------------------------------------------------
Scenario: server.url config key is registered
Then config key "server.url" should be registered
Scenario: server.token config key is registered
Then config key "server.token" should be registered
Scenario: server.tls-verify config key is registered
Then config key "server.tls-verify" should be registered
Scenario: server.namespace config key is registered
Then config key "server.namespace" should be registered
Scenario: server.tls-verify defaults to true
Then config key "server.tls-verify" should have default true
Scenario: server.namespace defaults to "default"
Then config key "server.namespace" should have default "default"
# -----------------------------------------------------------------------
# Config keys load from environment
# -----------------------------------------------------------------------
Scenario: server.url loads from CLEVERAGENTS_SERVER_URL environment
Then config key "server.url" should use env var "CLEVERAGENTS_SERVER_URL"
Scenario: server.tls-verify loads from CLEVERAGENTS_SERVER_TLS_VERIFY environment
Then config key "server.tls-verify" should use env var "CLEVERAGENTS_SERVER_TLS_VERIFY"
Scenario: server.namespace loads from CLEVERAGENTS_SERVER_NAMESPACE environment
Then config key "server.namespace" should use env var "CLEVERAGENTS_SERVER_NAMESPACE"
# -----------------------------------------------------------------------
# CLI connect command
# -----------------------------------------------------------------------
Scenario: CLI server connect prints stub warning
Given a temporary home directory for server tests
When I invoke server connect with url "https://stub.example.com" and format "json"
Then the server connect output should contain "not yet implemented"
And the server connect output should contain "stubbed"
Scenario: CLI server connect rejects invalid URL
Given a temporary home directory for server tests
When I invoke server connect with url "ftp://bad-url" and format "json"
Then the server connect should exit with non-zero code
# -----------------------------------------------------------------------
# Server mode resolution
# -----------------------------------------------------------------------
Scenario: resolve_server_mode returns disabled when no URL configured
Given no server URL is configured
Then resolve_server_mode should return "disabled"