testing

A deterministic testing boundary for Junjo agents that replaces a live AI provider with a scripted sequence of responses or errors. It records the exact requests sent to the test driver.

In plain words
What is it for?
Use it to test tool calls, final outputs, model failures, request ordering, usage-related behavior, and cancellation with controlled fixtures.
Why use it?
Tests can check agent behavior repeatedly without network access, provider credentials, or changing model responses. Separate driver instances also support concurrent test runs.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/mdrideout/junjo/testing
Clone the repo
git clone --depth 1 https://github.com/mdrideout/junjo
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 715 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00715
Opus 5 $0.00000 $0.00358
Sonnet 5 $0.00000 $0.00143
Haiku 4.5 $0.00000 $0.00072

Measured yesterday against content hash 389d557c1b74, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

testing scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

sdks/python/docs/content/docs/python/agents/testing.md · 83 lines

What it actually says

junjo.agent.testing is the public deterministic test boundary. It has no provider dependency.

ScriptedModelDriver consumes fixed response or error steps and captures the immutable ModelRequest values it received. Prefer a per-run factory when the same Agent definition is executed concurrently. Set fixture=True on its ModelDriverDescriptor when telemetry should identify the resulting model operations as deterministic fixture executions.

from junjo.agent import FinalOutputResponse, ToolCall, ToolCallsResponse
from junjo.agent.testing import ScriptedError, ScriptedModelDriver

driver = ScriptedModelDriver([
    ToolCallsResponse(tool_calls=[
        ToolCall(id="lookup-1", name="lookup", arguments={"query": "x"})
    ]),
    FinalOutputResponse(output={"answer": "done"}),
])

result = await agent.execute(input_value, dependencies=test_dependencies)
assert driver.requests[0].ordinal == 1
assert result.tool_call_completed_count == 1

Use ScriptedError(error) to prove ModelDriver failure behavior. For cancellation tests, a small custom driver or Tool service can await an asyncio.Event so the test controls the exact active boundary.

High-value deterministic assertions include:

  • exact normalized requests and transcript ordering;
  • whole-batch preflight before service side effects;
  • limits checked before the affected operation;
  • per-run factory construction and concurrent isolation;
  • typed failure causes and detached diagnostic state;
  • operation sequence, Store revision replay, and terminal span evidence.

Junjo performs no hidden retry or automatic output repair, so one script step always corresponds to one started model operation.

Shared producer conformance

The repository carries language-independent canonical producer fixtures in contracts/telemetry/fixtures/agent/producer. The Python SDK test discovers that directory exactly and executes every scenario through the real public Agent and Workflow APIs. It never imports the fixture generator. Controlled private fault injection is limited to the explicit admission, terminal-commit, and unexpected-internal-error scenarios.

Run the producer gate from sdks/python:

uv run pytest -q tests/test_agent_producer_conformance.py

The gate compares all contract-owned attributes and payload slots after normalizing only volatile identities and timestamps. It covers exact Agent and Tool structural identities, usage, error and cancellation facts, evidence-loss counters, physical and semantic parentage, Agent/Workflow hybrid topology, and payload modes and policies. RFC 6902 patch bodies may differ mechanically between language implementations, so the gate instead requires exact action, sequence, and revision evidence and independently replays both the emitted and canonical patches from owner start state to owner end state.

When this test fails, treat it as contract drift. Change runtime semantics and canonical fixtures together only after deciding which behavior is correct; never make the comparison looser to hide a mismatch. Then run the dependency- free shared validator:

python3 ../../contracts/telemetry/compatibility/validate_contract.py

Static generic conformance is separately proved by tests/test_agent_typing.py using one valid and one intentionally invalid consumer program.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 83 lines · 0 tokens per session scan A 389d557c1b74

Subscribe to this mod's changes

testing is an agent published in the GitHub repository mdrideout/junjo (20 stars, last pushed yesterday), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 715 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.