Tests and the real Proof Gate
Separate contract tests from the host boundary that proves stdin, auth, streaming, and exact output.
Pinned upstream commit: b189869b7755d2b482969acf6c92da3ecfeffd36
- Name what focused tests prove and what they cannot prove.
- Read an exact sentinel as a real protocol boundary.
- Keep Docker and production claims outside the host proof.
The big idea
Unit tests prove our translation rules without spending or depending on an installed CLI. A real smoke proves a different layer: the released `grok` binary accepts `/dev/stdin`, authenticates, streams JSONL, exits zero, and returns exactly the requested sentinel. Both are required; neither can stand in for the other.
Think of it like… Bench-test the adapter, then plug it into the real wall socket. A perfect bench reading cannot prove the building has power; a glowing lamp cannot prove every safety rule in the adapter. The analogy breaks because the live smoke also exercises a paid/remote model boundary.
Focused Vitest cases cover command construction, prompt isolation from argv, shell escaping, permission flag gating, effort enum mapping, mandatory built-in web-search disable, fail-closed sessions, text/end/error parsing, incomplete usage, and malformed input.
The host boundary was run on 2026-07-16 with Grok CLI 0.2.101: a prompt entered through `--prompt-file /dev/stdin`, the process exited 0, and ordered text deltas reconstructed exactly `GROK_DEV_STDIN_OK`. Prompt transport is proven on the current macOS host and expected in a future Linux image; native Windows, Docker readiness, and session resume are not yet proven.
Evidence: Pinned headless mode guide
Compare the boundaries
Safe: report each gate's exact boundary and output.
Risky: call a typecheck or host smoke “production complete”.
| Surface | Upstream | Alembic | Verdict |
|---|---|---|---|
| Unit contract | Deterministic parser/command behavior | Vitest | PROVE |
| Host CLI | Binary + stdin + auth + network + stream | Exact sentinel | PROVE |
| Docker / roster | Image install + credentials + routing | Not exercised here | NOT PROVEN |
The host boundary was run on 2026-07-16 with Grok CLI 0.2.101: a prompt entered through `--prompt-file /dev/stdin`, the process exited 0, and ordered text deltas reconstructed exactly `GROK_DEV_STDIN_OK`. Prompt transport is proven on the current macOS host and expected in a future Linux image; native Windows, Docker readiness, and session resume are not yet proven.
Real code and commands
packages/factory/src/GrokAgentProvider.test.ts + live host
pnpm --filter @alembic/factory test pnpm --filter @alembic/factory typecheck printf '%s' 'Reply with exactly GROK_DEV_STDIN_OK.' | \ grok --prompt-file /dev/stdin --model grok-4.5 \ --reasoning-effort low --output-format streaming-json \ --disable-web-search --always-approve --cwd /tmp # observed text result: GROK_DEV_STDIN_OK # observed exit: 0
How to reach it
sed -n '1,240p' packages/factory/src/GrokAgentProvider.test.ts grok --version && grok --help | rg "prompt-file|streaming-json|reasoning-effort"
Evidence: RESOURCES.md
Visual atlas
Practice and feedback
All unit tests pass, but `/dev/stdin` was never tried with the released CLI. Is the transport proven?
Retrieval cards
Inspect each proof layer
Select a gate to see the strongest honest claim it supports.
Four-slide summary
Check your model
What did `GROK_DEV_STDIN_OK` prove?