Skip to content

Latest commit

 

History

History
73 lines (63 loc) · 3.95 KB

external-drivers.md

File metadata and controls

73 lines (63 loc) · 3.95 KB

External drivers

The contract for spawning an external measurement tool: how a binary is resolved, how it is invoked, and what is retained. Tool-specific report semantics live in external oracles; the module-by-module walkthrough is architecture/drivers-external-substrate.md.

The product ships no installer and no remote execution: a tool binary is either already on the host or provisioned out of band by a qualification harness (scripts/qualification/provision-external-oracles.sh), which is test infrastructure rather than part of this contract.

Available drivers

External-process drivers include oha, h2load, iperf3, eggreplay-semantic, eggprobe, eggsec-waf, and eggsec-load. Native drivers are added by build features. doctor reports available drivers and whether external tool binaries are present without running them. run checks required external binaries and supported versions before starting managed services. See driver capabilities for workload and service compatibility.

When a plan requests Eggprobe diagnostics, doctor additionally performs the schema-0.3 compatibility handshake against the resolved eggprobe binary and reports the outcome (pass, unsupported-contract, probe-failed, missing-binary); without requested diagnostics no process is spawned. run always handshakes before managed startup.

Feature policy: default = []. The external command substrate is unconditional and is not feature-gated. Default builds contain no protocol client/server dependency.

Resolution policy

  • Explicit absolute paths only; relative explicit paths are rejected unless the caller resolved them against a trusted root first.
  • PATH search enumerates components manually: empty and relative components are skipped, there is no implicit current-directory lookup, and the first match in trusted absolute order wins.
  • Unix: candidate must be a regular file with executable mode bits.
  • Windows: only .exe/.com direct targets; .bat/.cmd wrappers are rejected (they need shell semantics). Current directory is never searched implicitly.
  • Symlink input is accepted but identity/hash cover the canonical target; both selected and canonical paths are recorded.
  • Executable identity is SHA-256 of canonical bytes plus file size and platform classification. The digest is diagnostic provenance, not a trust signature.
  • argv metacharacters stay literal; environment is env_clear plus explicit driver variables only (deterministic LC_ALL=C/LANG=C for probes). Tool stdout/stderr and full URLs never enter a stored DriverError, so errors are safe to surface. This does not extend to Debug: the command-spec type holding argv and environment derives Debug and renders them verbatim, so a spec must never be debug-logged.

Execution

  • argv[0] is the resolved path; no shell and no glob. A spec that requests no working directory leaves the child inheriting the parent's, so a spec that depends on a specific cwd must state one.
  • stdout/stderr are drained concurrently with independent caps; draining continues after the cap so children cannot block on a full pipe. Truncation is explicit (truncated, retained/dropped/total counters).
  • Callers that must deliver input (Eggprobe run - plans) use the bounded stdin_bytes payload (64 KiB cap, written once, then EOF); no temporary plan file is created and no shell is involved.
  • Cancellation token plus explicit driver timeout are always observed. Unix uses a dedicated process group (TERM then KILL, reusing runner semantics); Windows cleans up the direct child and reports direct_child_only.
  • Raw output is retained (stdout.raw, stderr.raw, command-metadata.json) before any semantic normalization. Parsers are versioned, fixture-testable, and independent of spawning; a parser failure never mutates the invocation into a different load/protocol semantic.