Skip to content

Public API Contract

Assertions

API-001 - The root module owns the supported import surface

Contract: ssh_wrapper MUST expose only the documented names in ssh_wrapper.__all__, include __version__, and import successfully without a consumer repository or optional runtime package.

Evidence:

API-002 - Connection authorities are validated structured values

Contract: ConnectionSpec MUST represent either one validated trusted OpenSSH alias or validated direct host, user, and port fields. Authority data MUST remain separate from option and remote-program arguments.

Evidence:

API-003 - One master object has a one-way lifecycle

Contract: OpenSSHMaster.start() MUST be single-use, readiness MUST require the owned mux, and loss or closure MUST never transition the same object back to a state that can authenticate again.

Evidence:

API-004 - Secondary command construction is mux-only

Contract: mux_transport_argv(), command_argv(), mux_ssh_command(), create_mux_wrapper(), and rsync_ssh_command() MUST bind to the existing private control socket and MUST prevent authentication or proxy fallback. Transport forms MUST not embed a destination.

Evidence:

API-005 - Expected failures use one stable error shape

Contract: Expected library failures MUST use SSHError with a stable code, human-readable message, and optional structured details. An empty details map MUST be omitted from to_dict().

Evidence:

API-006 - Remote process ownership is explicit and observable

Contract: OwnedRemoteProcess MUST require explicit heartbeat, lease, and grace timeouts; under the documented positive tail_bytes precondition, expose bounded stdout and stderr evidence plus the local mux status; and make repeated local closure safe.

Evidence:

API-007 - Public documentation mirrors the compatibility surface

Contract: Public API documentation MUST enumerate every root export, constructor requirement, compatibility-relevant default, enum value, and asynchronous lifecycle operation, including bounded-container preconditions. Documentation MUST NOT advertise an implementation-submodule import as supported API.

Evidence: