A real, in-memory Managoat.Sandbox adapter.
It lives under lib/, not test/support, on purpose: it is compiled in
every environment so that a host application's own suite can run
Managoat.Sandbox.ConformanceCase against it, drive a provisioning path
without a network, or register it in the adapter map — the same way
Ecto.Adapters.SQL.Sandbox ships inside Ecto rather than beside it.
Three jobs:
- prove the conformance suite is not Sprites-shaped — a second adapter has to pass it;
- exercise the owner-message contract for real — commands are actual
processes emitting the
{:stdout | :stderr | :exit, %{ref: ref}, _}frames, where most tests hand-craft them and can silently drift; - be the reference implementation the next adapter's author reads.
Commands speak a tiny scripted vocabulary instead of a shell — each arg is an instruction:
"out:<data>"/"err:<data>"— emit a stdout/stderr frame"exit:<code>"— emit the exit frame and stop"stay"— keep running: echo stdin writes back asecho:<data>stdout frames, exit 0 on stdin EOF"drop"— the transport closes without an exit frame; per the contract the adapter surfaces{:error, %{ref: ref}, :closed_before_exit}, andexec/4the matching{:error, {:unavailable, :closed_before_exit}}
A script with no terminal instruction exits 0. State lives in a named
Agent; call reset/0 in a setup block. Sessions buffer every emitted
frame, and attach/3 replays the buffer from the start before tailing —
the load-bearing semantic the conformance suite pins.
Summary
Functions
The file contents written at path, or nil.
The network policy last applied to name, or nil.