SPEC-018: Starters and the sloppy model¶
- Status: Implemented
- Milestone: v0.9 "Build your own"
- Owners: lead maintainer
1. Purpose¶
Two tools for people building on AgentPlay:
agentplaykit newcreates a working world, agent or wrapper with a scenario and a test, so a new user starts from something that runs instead of a blank file.- The sloppy model is a test double that makes the mistakes small models really make (seen in the debate runs: a placeholder word as the move, text that is too long, prose instead of JSON). World authors can find and fix these problems in a test, before real models do.
2. Terms¶
Keywords MUST, SHOULD and MAY follow RFC 2119.
- Starter: the set of files agentplaykit new writes.
- Mistake: one kind of bad model output, named in SCF-006.
- Sloppy model: an agent in agentplaykit.testkit that writes raw model text, sometimes with
mistakes, and turns it into a reply with the same parser as real model agents.
3. Requirements¶
agentplaykit new¶
- SCF-001
agentplaykit new world <name>(andagentplaykit new workspace <name>, SPEC-030 WSP-022) (and, with--kind matrix|quiz|conversation, a world file instead of Python, SPEC-029 NCW-014) MUST write, in a new folder<name>/(or--dir): a world file built with the helpers of SPEC-017, ascenario.yamlthat runs it with scripted agents and no key, and atest_<name>.pythat checks it with the testkit and the sloppy model. - SCF-002
agentplaykit new agent <name>MUST write an agent file, a scenario that plays it againstscripted/randomin tic-tac-toe, and a test. - SCF-003
agentplaykit new wrapper <name>MUST write a wrapper file (SPEC-016), a scenario that uses it, and a test. - SCF-004 Every starter MUST work as written:
agentplaykit checkaccepts the scenario,agentplaykit playruns it to the end, and the test passes withpytest. Generated files MUST carry comments that say what to change, and the SPDX line when written inside this repository. - SCF-005
newMUST refuse to overwrite an existing file or folder, and MUST reject a name that is not a lowercase identifier (letters, digits,-and_), saying which names work. - SCF-006
newMUST print the files it wrote and the next three commands to run.
The sloppy model¶
- SCF-007
agentplaykit.testkitMUST provideSloppyModel, an agent that writes raw text and turns it into a reply with the shared model parser (ADP-009), so parsing problems reach the world exactly as they would from a real model. - SCF-008 It MUST support these mistakes, chosen with
mistakes=[...]:word_only(a placeholder word such as "argument" or "move" as the action, the real text insay),too_long(twice the allowed length),prose(no JSON at all),wrong_key(the move under another key, such as{"move": ...}),fenced(JSON inside a code fence with text around it),wrong_type(a number sent as text, or text as a number),empty(an empty action),repeat(the previous action again) andambiguous(prose that names two legal moves). Since v0.15 the parser readsproseandwrong_keyreplies (SPEC-025 REL-006), as it would a real model's;ambiguousstays unreadable. Withconstrain: truethe sloppy model makes only therepeatmistake (SPEC-025 REL-015). - SCF-009 It MUST be deterministic from its seed, make mistakes at a configurable
rate(default 0.5), and afterrecover_afterconsecutive mistakes (default 2) send a valid move sampled like the testkit's (SPEC-017 WLD-009), so tests can check that a world lets models recover. - SCF-010
agentplaykit test <world.py> --sloppyMUST play the world against sloppy models for every mistake and report, per mistake: games finished, forfeits, and the error texts the world returned. It MUST flag error texts that do not say what a valid move looks like. - SCF-011 The testkit MUST provide
run_with_sloppy_models(world, mistakes=..., seeds=...)returning these results as plain data, for use in pytest.
4. Acceptance criteria¶
| Requirement | Test ID | Notes |
|---|---|---|
| SCF-001..006 | SCF-001..SCF-006 |
generate each starter in a temporary folder, then check, play and pytest it; refusal cases |
| SCF-007..011 | SCF-007..SCF-011 |
each mistake's raw text and parsed reply; determinism; recovery; the --sloppy report on the debate world and on a world with unhelpful errors |
5. Examples¶
agentplaykit new world auction
cd auction
agentplaykit play scenario.yaml
pytest
agentplaykit test auction_world.py --sloppy
sloppy models vs auction_world.py (5 seeds per mistake)
word_only 5 finished, 0 forfeits
too_long 3 finished, 2 forfeits error: "too long" <- does not say what a valid move is
prose 5 finished, 0 forfeits
...
from agentplaykit.testkit import run_with_sloppy_models
def test_debate_survives_small_model_mistakes():
results = run_with_sloppy_models(Debate, mistakes=["word_only", "too_long", "prose"])
assert all(r.forfeits == 0 for r in results)
6. Open questions¶
- Mistakes for tool-calling models (malformed tool arguments).
- A
--from-logsmode that learns mistake rates from real run logs.
7. Change log¶
- 2026-12-01: Initial draft.
- 2026-12-01: Accepted by the lead maintainer for v0.9.
- 2026-12-03: Implemented in v0.9.0; every requirement has a test.
- 2026-12-03: SCF-008 adds the
ambiguousmistake andconstrain, with SPEC-025. - 2026-12-04: SCF-001 adds
--kindfor world files, with SPEC-029. - 2026-12-04: SCF-001 mentions
new workspace, with SPEC-030.
Changes to other specs on acceptance¶
- SPEC-007, new CLI-017:
agentplaykit new world|agent|wrapperandtest --sloppy.