simulate: play every case through every state, judge only what a model can

`portal-trainer simulate` reads the model `question_lint --needs-sim`
exports. A visitor model picks an alternative and fills the form in a
manner that varies by run; the case is then walked along the handling
group's own desk buttons to a finished state, a different one each
run, so every state and button is exercised. At each button the
handler model is asked one thing: with only what the form collected,
could this role really do what the button claims? Its question goes
back to the visitor, who may not know.

Who wins is deliberately not simulated. The first version let the
handler decide: qwen3:8b sent every case to "won", and after one
sentence of prompt change, every case to "lost". Outcomes belong to
the live bucket; `success` in needs.yaml is what a report over real
records counts.

`compare` sets two score files side by side. engines/ollama.sh honours
SEED, FORMAT=json and TEMPERATURE so the same case replays the same
way against two versions of a site. generator/reference.md documents
`success` and `stages`.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L4jrCgLiKKHAEFuZUJjckH
This commit is contained in:
Bendik Aagaard Lynghaug
2026-09-21 19:16:28 +02:00
co-authored by Claude Fable 5.1
parent e163c22792
commit 02672547ee
4 changed files with 581 additions and 2 deletions
+6
View File
@@ -36,6 +36,12 @@ needs:
done_when: [<state>, <state>] # every state that counts as finished, good or bad
max_steps: 1 # submissions before the record exists (1 or 2)
max_fields: 4 # required fields the visitor will tolerate across the path
success: [<state>] # the done_when states that are a good outcome for the business
stages: [open, <stage>, <stage>, <end>, <end>]
# EVERY stage the business said a case goes through, first to last,
# read off their own sentences one verb at a time ("they come in, we
# go and look, we send a quote, we win or lose it" is five stages).
# The state machine must have a state for each, or the verifier fails.
personas:
- id: kebab-case
need: <need id>