Mocking and fixtures
Gust is not a universal mocking framework. Industry practice is to evaluate trajectories while leaving world control to normal DI, language mocks, WireMock, test containers, or sandboxes. Gust follows that boundary.
World-control modes
| Mode | Who owns dependencies | When to use |
|---|---|---|
existing (default when no fixtures) |
Your harness / QA mocks | Preferred adoption path; no Gust tool routing required |
gust (default when fixtures present) |
Gust fixture proxy | Selected tools need deterministic responses or failure injection |
environment:
world_control: existing # or gust
fixtures_dir: fixtures # only needed for gust mode
Gust fixture lifecycle (world_control: gust)
sequenceDiagram
participant Gust
participant Agent
participant Proxy as FixtureProxy
participant Provider as FixtureProvider
Gust->>Proxy: Start per-sample clone
Gust->>Agent: tool_endpoint plus sample context
Agent->>Proxy: POST /v1/tools/call
Proxy->>Provider: Lookup by hash or sequence
Provider-->>Proxy: Recorded response or injected failure
Proxy-->>Agent: Tool result
Note over Proxy: Missing fixture returns 404 fail-closed
Agent-->>Gust: AgentRun or OTel trace
- Load authored/extracted fixture JSON into a
FixtureProvider. - Clone the provider per concurrent sample and bind an ephemeral loopback proxy.
- Inject
AGENTEVAL_FIXTURE_ENDPOINT/tool_endpointinto the sample adapter. - Only tools deliberately routed to
POST {endpoint}/v1/tools/callare mocked. - Match by RFC 8785 argument hash, ordered sequence, or exact-then-sequence.
- Return the recorded body or inject
slow/timeout/malformed/partial_failure. - Missing fixtures fail closed (HTTP 404). Gust never silently calls production.
- Failed samples can include a fixture call ledger (matched fixture id, mode, sanitized body).
Limitations (current milestone)
- Fixture proxy binds loopback only. Same-host agents (CI job / laptop) are supported.
- Remote QA must use
world_control: existingand the customer’s own mocks. - No transparent HTTP/MCP interception and no remote Gust fixture service yet.
- Tools that never call the proxy are unaffected — routing is explicit.
Production safety
- Unset fixture endpoint → production code paths stay unchanged.
- Configured Gust fixtures with no match → error, not passthrough.
- External side effects require an acknowledged QA/test configuration outside Gust.