Documentation

35.17 Testing without a language model

Testing without a language model

--llm-backend mock --llm-script replies.json replays a JSON list. The language turn is scripted, but help/manual/read/save, policy, confirmation, child execution, settings, result handling and audit are real. This supports deterministic demonstrations and regression tests.

How to use it

Build scripts for success, refusal, question, malformed/unknown option, bad template key, correction, repeated failure, max-steps, confirmation and guide behavior. Assert exit code plus audit events, executed command count, refusal reason, settings content, output confinement and checksums.

Practical interpretation

Chapter 35 preserves six mock sessions: help/docs/read, guide, save-and-run ER, bad key, failed-path correction, and unanswered question. Chapter 34 adds approved, plan-only and self-call refusal evidence.

Executed/reference evidence: Bad-key transcript.

Building a useful mock suite

A mock script is an ordered list of model replies, so write it to exercise the state transition you care about. A simple run script proposes one valid command. A correction script proposes a known failure and then a materially changed command. A refusal script proposes a forbidden action. A question script returns a question. A save script requests a template, saves valid settings, and proposes the corresponding child command.

Assertions should inspect more than console text: normalized action, refusal category, confirmation behavior, number/order of commands, child exit codes, settings snapshots, output paths, request end reason, and checksum verification. Use temporary or chapter-owned output directories so tests are isolated. Because the mock backend bypasses actual language generation, it is ideal for testing deterministic orchestration after a code change. It cannot establish whether a real model will choose the intended action, summarize faithfully, or remain stable under paraphrase.

A safe novice workflow

  1. Start with the narrowest backend, policy, files and command set that can answer the request.
  2. Name exact inputs and decisions; use guide or plan-only before granting execution.
  3. Inspect the normalized command and complete settings file, not only Maxson’s explanation.
  4. Read request end state, native command result, warnings, outputs and checksums.
  5. Preserve the session and record the qualified person’s interpretation and disposition.

Review and pitfalls

A passing mock suite does not qualify real-model wording. Pair it with fixed real-model requests under plan-only/guide first, then narrowly permitted runs. Never use a random-weight test GGUF as an assistant.

  • A session exit code of zero does not prove that every proposal ran or succeeded.
  • Model fluency, structured JSON, and policy approval do not establish scientific validity.
  • Settings and commands are reproducibility inputs; they still require versioned software and frozen data.

What to retain

Retain .ask, backend/model identity, system prompt, request, raw/normalized replies, transcript, JSONL events, settings versions, commands, child logs/outputs, checksums, exceptions, and reviewer conclusions.

See the previous page, next page, and complete ask command and settings index.