feat(run): controlled scenario system_prompt (fixes uncontrolled-prompt A/B bias)#17
Closed
jahala wants to merge 2 commits into
Closed
feat(run): controlled scenario system_prompt (fixes uncontrolled-prompt A/B bias)#17jahala wants to merge 2 commits into
jahala wants to merge 2 commits into
Conversation
…_prompt FIX-TIMEOUT: the agent-subprocess kill timeout was wired to the CLI --timeout flag (default 300), so a scenario's timeout_seconds (e.g. 600) was silently ignored — two tilth runs on ripgrep were killed at 300s though full-sonnet set 600. The scenario runner factory now uses scenario.timeout_seconds; single-run keeps the --timeout flag. PROMPT-1: add Mode.append_system_prompt — a DISCLOSED per-mode instruction so a tool can be measured as it's actually deployed (tools ship with usage guidance, like the operator's global CLAUDE.md). claude gets --append-system-prompt; codex/gemini prepend it to the prompt. The text is recorded as `mode_append_system_prompt` in every JSONL record so the A/B asymmetry is never hidden. The local tilth.yaml now nudges "prefer tilth_search/tilth_read over Grep/Read" to address low adoption (only 14/44 non-control tasks used tilth in the full-sonnet run). 882 tests green; ruff clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…cross arms)
copeca inherited the agent CLI's full default system prompt (which promotes
the native Read/Grep/Glob tools), so any tool-under-test that competes with
native tools was systematically under-adopted — the system prompt was an
UNCONTROLLED variable, breaking the "hold everything fixed, vary one thing"
guarantee. Empirically: the same tilth+sonnet+version that tilth's own
(lean-prompt) harness measured cheaper, copeca measured costlier, because its
agent used tilth ~30% vs tilth's ~100%.
Add Scenario.system_prompt: a fixed prompt threaded to EVERY arm (baseline +
experimental) via the runner's --system-prompt, REPLACING the CLI default so
the prompt is a controlled, held-constant condition. "{cwd}" is substituted
with the per-run worktree path. None keeps the CLI's own default (prior
behavior, fully back-compatible).
- config/models.py: Scenario.system_prompt field (documented)
- orchestration/run.py: thread scenario.system_prompt -> run_single ->
build_command, with {cwd} substitution
- tests: system_prompt reaches build_command on every arm; None => None
Verified offline: baseline and experimental arms build byte-identical
commands except the experimental's --mcp-config.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Owner
Author
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.
Why
copeca's A/B promise is "hold everything fixed, vary one thing." But it inherited the agent CLI's full default system prompt (which promotes the native Read/Grep/Glob tools) — an uncontrolled variable. Any tool-under-test that competes with native tools was systematically under-adopted.
Empirically (this branch's investigation): the same tilth + Sonnet + version that tilth's own lean-prompt harness measured cheaper, copeca measured costlier, purely because copeca's agent used tilth ~30% vs tilth's ~100%. Matching the system prompt flips adoption.
What
Add
Scenario.system_prompt— a fixed prompt threaded to every arm (baseline + experimental) via the runner's--system-prompt, replacing the CLI default so the prompt is a controlled, held-constant condition.config/models.py:Scenario.system_promptfield (documented).orchestration/run.py: threadscenario.system_prompt→run_single→build_command, with{cwd}→ per-run worktree substitution.tests: system prompt reachesbuild_commandon every arm;None⇒None(CLI default kept — fully back-compatible).Validity
Verified offline that
baselineand experimental arms build byte-identical commands except the experimental's--mcp-config. Local CI green:ruff format --check+ruff check+ 885 passed.(Net diff is the system_prompt feature only; the branch's earlier timeout/append-prompt commit already landed on master.)
🤖 Generated with Claude Code