Repository navigation
Playground: replay a study with any model and compare it to the people - #14
Merged
Merged
Conversation
study_006 overrides load_material but resolves it against the study root instead of source/, so every material lookup missed and the study could not be loaded at all. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Researchers can pick a study, a base model, and the prompt their agent takes into the experiment, then see where the agent behaved like the original participants and where it did not. The runner drives each study's own trial builder and evaluator, so a playground run is scored exactly like a benchmark run; the model, the participant prompt, and the participant count are what change. Every model is routed through OpenRouter. Results are charted and interpreted by Claude Code against the contract in playground/CLAUDE.md. Its output is validated on the runner before it is stored, and anything invalid or late falls back to deterministic charts, so a run always ends with charts a researcher can read. Runs on the shared key are capped. A researcher can supply their own OpenRouter key for a larger budget; the web app seals it with AES-256-GCM under PLAYGROUND_KEY_SECRET, so the private jobs repository only ever holds ciphertext, and the workflow drops it when the run ends. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the engine behind the HumanStudy-Hub playground: pick a study, a base model, and the prompt the agent takes into the experiment, then see where the agent behaved like the original participants and where it did not.
How it works
playground/run_playground.pydrives each study's ownscripts/config.pyandscripts/evaluator.py, so a playground run is scored exactly like a benchmark run. The model, the participant prompt, and the participant count are the only things that change. Every model — including Claude and Gemini names — is routed through OpenRouter by passing the OpenRouter base explicitly.playground/analysis.pynormalises the two evaluator output shapes into one comparison table. Eleven studies already enrich their test results with effect sizes; for the rest it derives Cohen's d from the paper's reportedF/t/rand from the agent's t-statistic. Tests with no honest single-d equivalent (multi-numerator F, chi-square) are left out of the effect-size comparison rather than given a substituted zero.Charts and the written reading come from Claude Code through OpenRouter, following the contract in
playground/CLAUDE.md.validate_charts.pychecks the output on the runner before it is stored — plain JSON only, restricted trace types, no*src/metafields — and anything invalid or late falls back to the deterministic charts indefault_charts.py. A run always ends with charts a researcher can read.Run budget and researcher keys
Runs on the shared
OPENROUTER_API_KEYare capped at 60 participant sessions. A researcher who supplies their own key gets 600. HumanStudy-Hub seals that key with AES-256-GCM under a secret shared with this workflow, so the private jobs repository only ever holds ciphertext, and the workflow drops it once the run ends.Repository settings this needs
PLAYGROUND_KEY_SECRETOPENROUTER_API_KEYHUMANSTUDY_PIPELINE_TOKENPLAYGROUND_CHARTS_MODELanthropic/claude-sonnet-5Separate commit: study_006
studies/study_006/scripts/config.pyoverrodeload_materialbut resolved it against the study root instead ofsource/, so every lookup missed and the study could not be loaded at all — by any runner, not just the playground. Kept as its own commit.Verification
--simulate(no API calls).pytest tests— 127 passed (118 existing, 9 new intests/test_playground.py).Not yet exercised: a real dispatched run against OpenRouter. That needs this branch on
mainfirst, since GitHub can only dispatch a workflow that exists on the default branch.🤖 Generated with Claude Code