Repository navigation
Description
This was generated by AI during a grill-with-docs session.
Grilled in docs/grill-with-docs/done/1468-custom-runner-arm.md (Rounds 1–3). Decisions: ADR 0032 (a Custom runner runs inside one Trial sandbox and returns a commit and session traces), ADR 0027, ADR 0028, and ADR 0026. Research: docs/research/eval-process-arms-and-human-review.md, docs/research/process-comparison-cost-accounting.md, and docs/research/process-comparison-grading-and-evidence.md.
Problem Statement
thirdshift can compare two Process Arms—its Built-in Ticket run or Custom processes—end to end on process Eval suites (#1484, #1872). It still cannot pit a Process Arm against a setup whose orchestrator thirdshift does not run itself: an outside multi-agent skill loop, a Python or SDK scaffold, or another coding-agent framework. Running that comparison by hand (#1628) took thousands of lines of bespoke scripts, separate OS accounts for isolation, manual skill-branch tracking as prompts drifted mid-run, and custom token parsers that hit Anthropic/OpenAI cache-accounting mismatches and missed deleted round transcripts.
Solution
Add Custom runner Arms to process Experiments (ADR 0032). Either the Baseline arm, the Candidate arm, or both may name a declarative Custom runner manifest (~/.thirdshift/runners/<name>.toml or an explicit .toml file) in place of a thirdshift commit and Process.
- Symmetric CLI and Console start:
--baseline-runnerand--candidate-runnerselect a Custom runner onprocesssuites (--suiterequired; review suites and--releaserefused). When--candidate-runneris set, the positional<candidate>commit is omitted; when Baseline is a thirdshift build and Candidate is a Custom runner,--baselinedefaults toHEAD; when both Arms are Custom runners, no thirdshift checkout or Cargo build is needed (Q1.2, Q2.1, Q2.2). - Frozen manifest and provenance:
prepare-armsfreezes the manifest and every file or skill folder it maps (into the runner bundle or into relative paths inside freshHOME) by SHA-256, records enclosing Git repository,HEADcommit, anddirtystate as provenance without refusing local uncommitted edits, pins declared Harnesses by real path and version, and checks every hash before each Trial. Optionalgit_excludepatterns are appended to.git/info/excludebefore the Custom runner starts so runner scratch directories never leak ontoHEADor break blind pairwise review (Q1.3, Q2.3, Q3.2). - One Trial-wide sandbox: one
bwrapsandbox inside the Trial'ssystemd-runmemory scope encloses the Custom runner and every child process it spawns. FreshHOMEholds only declared Harness logins (with Grok serialization and multi-provider OpenCode config), Trials-only direct-SDK provider keys from[providers]in Credentials, one allowlistingHTTPS_PROXYopening only declared provider API hosts, and thinPATHwrappers ahead of pinned Harnesses that prepend each Harness's no-web-search switch (Q1.4, Q2.4). - Unattended commit and result contract: the Custom runner receives version-1
request.json, runs strictly unattended with no simulated user, commits its final change onHEAD, and writes version-1result.json(delivered,stopped_to_ask,failed, orvoidlimited tosession_unavailable,usage_limit,rate_limit). Outer supervision keeps precedence; runner crashes or missingresult.jsonwithout outer Void evidence record that Trial asfailedrather than aborting the Experiment (Q1.5, Q1.7, Q2.5). - Unified OTLP session traces and
accounting_gapchecks: Custom runners either wrap CLI calls with the in-sandboxrecord_command(--role <role>, giving live streaming and mid-Trial 85% quota stops) or writesessions.jsonlisting raw Harness streams and/or direct-SDK records with explicituncached_input_tokens. thirdshift converts every session into OTLP.logs.jsonland.spans.jsonlpriced solely from the Experiment's frozen price table, voids Trials whose transcripts contain web-search tool calls, and voids Trials asaccounting_gapwhenever outbound proxy traffic or Harness wrapper runs exceed recorded sessions (Q1.6, Q2.6). - Smoke-testing before 60 Trials:
thirdshift evals check-runner <name-or-file.toml> [--suite <suite> --task <task>](and its Console API twin) validates a Custom runner statically or runs one sandboxed Trial dry run with code checks and accounting outside Experiment storage (Q3.1).
User Stories
- As the Day shift, I want to pit thirdshift's Built-in Ticket run against a Custom runner on a
processEval suite, so that I can test an outside agent workflow with the same code Graders, Grader panel, and blind pairwise review. - As the Day shift, I want to use a Custom runner as the Baseline arm, the Candidate arm, or both, so that I can also test an edit to an outside workflow against an earlier version of itself without building thirdshift.
- As the Day shift, I want
--candidate-runnerto omit the positional<candidate>commit and default--baselinetoHEADwhen Baseline is a thirdshift build, so that starting a comparison does not require an unused commit argument. - As the Day shift, I want
code-reviewsuites,spec-reviewsuites,--release, and conflicting--*-process,--*-harness,--*-model, or--*-effortflags on the same Arm refused before dispatch when a Custom runner is named, so that invalid combinations fail immediately. - As the Day shift, I want a Custom runner defined in a
.tomlmanifest under~/.thirdshift/runners/or by file path, so that multi-provider setups stay repeatable and readable. - As the Day shift, I want every script and skill directory listed in a Custom runner manifest frozen by SHA-256 before the first Trial and verified before every Trial, so that editing files on the host mid-Experiment cannot silently alter later Trials.
- As the Day shift, I want frozen files mapped either into the runner's bundle directory or into relative paths inside fresh
HOME(rejecting..and absolute targets), so that skills expected in~/.claude/skills/or~/.agents/skills/work inside the sandbox without copy boilerplate. - As the Day shift, I want
prepare-armsto record the enclosing Git repository,HEADcommit, anddirtyflag for frozen source paths without refusing uncommitted edits, so that local skill experiments stay fast while retaining full provenance. - As the Day shift, I want optional
roles(role -> { model, effort }) recorded in the Arm record for human inspection while pricing still comes from observed session Models, so that Experiment reports document what each role was configured to run. - As the Day shift, I want
Setupto recordrunnerandrunner_digestwithcommitandharnessnullable, so that Experiment resume, per-Arm cost estimates from past Experiments, Trial Peek, and post-submission pairwise reveal identify Custom-runner Arms accurately. - As the Day shift, I want optional
git_excludepatterns in the manifest appended to.git/info/excludebefore launch and checked againstHEADafterward, so that in-worktree scratch directories cannot leak into blind pairwise diffs. - As the Day shift, I want the whole Custom runner and its child processes enclosed in one
bwrapsandbox andsystemd-runmemory scope, so that an outside orchestrator has the same filesystem, time-safety, and memory boundary as native Process Trials without separate OS accounts. - As the Day shift, I want only the logins for declared
harnessesand Trials-only[providers]API keys from Credentials placed inside the sandbox (recording asession_unavailableVoid Trial when one is missing), so that undeclared credentials and ambient shell variables are never exposed. - As the Day shift, I want
HTTPS_PROXYinside the sandbox to allow only the union of declared Harnesses' and providers' API hosts, blocking GitHub and general web hosts, so that the Custom runner cannot read the shipped fix from the network. - As the Day shift, I want thin
PATHwrappers ahead of pinned Harness binaries to prepend each Harness's no-web-search switch and any web-search tool call in a transcript to void the Trial, so that provider-hosted web search cannot leak public fixes over allowed API hosts. - As the Day shift, I want a Custom runner's declared Harnesses and direct-SDK providers included in the Grader panel's Arm families, so that same-family panel seats withhold their votes and stand-in family checks hold before Trials begin.
- As the Day shift, I want the Custom runner invoked with a versioned
request.jsonand graded on committedHEADplusresult.json, so that binary changes, renames, and multi-commit branches flow into code Graders and Pair evidence without patch-application failures. - As the Day shift, I want Custom runner Trials to run strictly unattended with
stopped_to_askcounted as a failed Score and tallied beside the Verdict, so that neither Arm receives extra help on ambiguous Tickets. - As the Day shift, I want a Custom runner crash, missing
result.json, or invalid self-reported outervoid_causerecorded as afailedTrial (with exit status and stderr incause) rather than aborting the whole Experiment, so that one broken task does not ruin a 60-Trial overnight run. - As the Day shift, I want an optional in-sandbox
record_command(--role <role>) that streams supported Harness CLIs live into the Trial's session folder, so that multi-session CLI runners get mid-Trial 85% quota pauses and cannot accidentally delete finished session files. - As the Day shift, I want
sessions.jsonto accept both raw Harness JSONL streams and direct-SDK records with explicituncached_input_tokens, converted into OTLP.logs.jsonland.spans.jsonland priced from the Experiment's frozen price table, so that Anthropic and OpenAI cache conventions are never confused and every Experiment view reads one trace format. - As the Day shift, I want Trials where outbound provider proxy traffic or Harness wrapper runs occurred without matching recorded sessions voided as
accounting_gap, so that omitted or deleted sub-agent sessions never produce artificially cheap$0.00Trials or skip leak checks. - As the Day shift, I want
thirdshift evals check-runner(statically or on a single--suiteand--task) and its Console API twin, plusbaseline_runnerandcandidate_runneron Console Experiment start, so that I can smoke-test a new Custom runner quickly and run it from either the CLI or the Console.
Implementation Decisions
- Arm definition and
Setupschema (format 13). An Arm is either a thirdshift build or a Custom runner, never both.Setupmakescommitandharnessnullable (nullon a Custom-runner Arm) and addsrunner(manifest name) andrunner_digest(SHA-256 over the frozen manifest and mapped files). SerializedSetupcontinues to key per-Arm cost history and Experiment resume checks. - Suite and CLI validation. Whenever either Arm uses a Custom runner,
--suiteis required and every named suite must be aprocesssuite;code-reviewsuites,spec-reviewsuites,--release, and per-Arm--*-process,--*-harness,--*-model,--*-effort, or commit arguments on the Custom-runner Arm are refused before dispatch. When Baseline is a thirdshift build and Candidate is a Custom runner,--baselinedefaults toHEAD; when both Arms are Custom runners, neither a thirdshift Git worktree nor Cargo build is required. - Custom runner manifest and freezing. Looked up under
~/.thirdshift/runners/<name>.tomlor as an explicit.tomlpath. Declarescommand = [...](argv, no shell splitting),files(frozen by SHA-256 intorunner_diror mapped to validated relative paths inside freshHOME),harnesses(pinned by real path and--version, with<provider>/<model>or alias entries where OpenCode or Kimi needs host resolution),providers(direct-SDK provider names from the proxy host catalogue), optionalroles(role -> { model, effort }), and optionalgit_excludepatterns. Enclosing Git worktree origin/path,HEADcommit, anddirtyboolean are recorded in the Arm record for source paths without blocking uncommitted edits. Every frozen file's SHA-256 is verified before each Trial. - Single Trial sandbox, Credentials, and web-search wrappers (ADR 0032). Credentials gains a Trials-only
[providers]table for direct-SDK keys. One Trial-widebwrapsandbox (inside the Trial'ssystemd-runmemory scope) encloses the Custom runner and its child processes with freshHOME, logins only for declaredharnesses(acquiring the Grok lock whengrokis declared and constructing multi-provider OpenCode config with web tools denied whenopencodeis declared),[providers]API keys only for declaredproviders, one allowlistingHTTPS_PROXYfor the union of declared provider API hosts, and thinPATHwrappers ahead of pinned Harness binaries that prepend each Harness's no-web-search switch while preserving stdin, stdout, stderr, and exit status. Declared Harnesses and providers union intoarm_familiesfor the Grader panel. - Execution contract (
request.jsonandresult.json, version 1). Before launch,git_excludepatterns are appended to.git/info/excludealongside.thirdshift-issue.md.request.jsonsuppliesversion,repository,issue_file,issue_url,base,branch,runner_dir,output_dir, andrecord_command. Outer supervision (interrupted,sandbox_unavailable,memory_cap,host_killed, liveusage_limit, timeout ->failed) keeps precedence. Missing/unreadableresult.json, nonzero exit without a validresult.json, claiming an outervoid_cause, or committing a path matchinggit_excludeonHEADmarks the Trialfailed(with exit status and stderr incause) without aborting the Experiment. Self-reportedvoid_causevalues inresult.jsonare restricted tosession_unavailable,usage_limit, andrate_limit. Uncommitted working-tree files are ignored by grading (noted in diagnostics). - Session conversion and
accounting_gap. Custom runners record sessions either live viarecord_command --role <role> -- <harness> ...(enabling live 85% quota monitoring) or post-run viaoutput_dir/sessions.jsonentries for raw Harness streams ({ role, harness, stream_file, started_at, ended_at }) and direct-SDK sessions ({ role, transcript_file, started_at, ended_at, models: { <model>: { uncached_input_tokens, cache_read_tokens, cache_write_tokens, output_tokens } } }). Both convert into OTLP.logs.jsonland.spans.jsonlin the Trial's session folder, priced solely from the Experiment's frozenprices.json(convertinguncached_input_tokensinto cache-inclusiveMeasurement.input_tokensfor pricing). Any web-search tool call in normalized transcripts voids the Trial.HTTPS_PROXYandPATHHarness wrappers count outbound provider connections and non-probe Harness runs; if provider traffic occurred (or a runner with declaredharnesses/providersendeddeliveredorstopped_to_ask) with zero recorded sessions—or fewer Harness session entries than Harness runs that crossed the proxy—the Trial is voided asaccounting_gap. evals check-runnerand Console parity (ADR 0026).thirdshift evals check-runner <name-or-file.toml> [--suite <suite> --task <task>]validates the manifest, files, Harnesses, logins/[providers]keys, androlesModels statically, or runs one standalone Trial dry run with grading and accounting outside Experiment storage when--suiteand--taskare given. Console API parity adds/api/v1/evals/check-runnerand extends/api/v1/start(experiment) withbaseline_runnerandcandidate_runner, while Experiment detail, Trial Peek, and pairwise reveal render nullablecommit/harnessand Custom runner provenance cleanly.
Testing Decisions
- Test external behaviour through existing CLI and HTTP boundaries: Experiment JSON output, Verdicts, Void and failure classifications,
evals prepare-armsandevals check-runnerJSON, Console API parity, and HTML/JSON rendering before and after pairwise submission. - Seams:
thirdshift experiment ... --json,thirdshift evals prepare-arms, andthirdshift evals check-runner --jsonthrough the Experiment test fixture, using fake Custom runner scripts, fake Harness scripts, and a loopback provider server behindHTTPS_PROXY(running inside realbwrapwhen available andTHIRDSHIFT_TRIAL_NO_SANDBOXotherwise).- Console HTTP and parity tests covering
/api/v1/start(experiment),/api/v1/evals/check-runner,/experiments/<id>, Trial Peek, and/experiments/<id>/pairs/<pair>.
- Prior art: the
processExperiment tests, sandbox and accounting Experiment tests, Arm preparation tests, and the Console'sexperiments,pairwise,start, andapiparity tests.
Out of Scope
- Running Custom runners on
code-revieworspec-reviewEval suites, or as top-level factory Commands (Ticket run,Review run, etc.). - Container-per-runner packaging (Harbor
BaseInstalledAgentimages). - Simulated-user Q&A turns when a Custom runner stops to ask a question.
- Trusting runner-reported USD figures instead of pricing tokens from the Experiment's frozen price table.
Further Notes
- Sub-issue Hand-run comparison of the Built-in Ticket run against a Custom process, by replaying closed issues #1628's 10 paired hand-run replays informed the failure modes guarded here: mid-Experiment skill drift, scratch
.review-runs/files in worktrees, deleted round directories causing uncounted spend, and Anthropic vs OpenAI cache-inclusivity differences.
Activity
JacobStephens2 commentedon Oct 27, 2026
Triage notes
What we've established so far:
skills/thirdshift-*content is a skill-set comparison today, on the Eval suites those skills select.~/.thirdshift/skillsnever reaches them.Still open, and for #1484's grill: should an Arm be defined by a Custom process, or by a mapping of skill names onto a fixed build? A process Arm only means something on implement Eval tasks, so this waits on #1484.
Stays
needs-triage, blocked by #1484.JacobStephens2 commentedon Oct 28, 2026
A first concrete case for this issue, from Jacob: compare thirdshift's Built-in processes, run with the Factory skills, against a contractor's process. The contractor proposes their process as having better verification and better code quality. It uses different skills, a different number of code reviews, different code-review skills, and a lot of multi-family (cross-family) review.
What the process files will give this, per the grill in
docs/grill-with-docs/more-built-in-processes.md:ticket-run, so the two processes can be compared side by side as files first.run-published-issue, and a newland-ticketsfor Spec runs) take aprocesssetting, so a copied Spec run can send every Ticket through the contractor's Ticket process.The next blocker is #1531: the code review runs inside the
implementsession, so a copy ofticket-runcan't yet change the number, skills or model family of its reviews.Merge pull request #1629 from JacobStephens2/pocock-vs-lighthouse-exp…
JacobStephens2 commentedon Nov 3, 2026
Triage notes
The concrete case from the last comment has now been run by hand, outside thirdshift: ten paired live runs, with the Ticket run as one Arm and a contractor's maker-checker TDD process as the other, graded blind. These are the findings that bear on defining an Arm as a whole process. Results stay private; only the lessons about Arms are here.
What we've established so far:
evals prepare-armsalready records), the model and effort per role, and the orchestrator's harness.Answer to the open question, for #1484's grill: both, plus a third kind. A Custom process (once #1531 splits out the review) suits thirdshift-native alternatives. A skill mapping onto a fixed build suits swapping skills only. A process with its own orchestrator needs an external-runner Arm.
Stays
needs-triage, blocked by #1484.[-]Experiments: compare two skill sets or Custom processes as Arms[/-][+]Experiments: an external-runner Arm for processes thirdshift doesn't run itself[/+]JacobStephens2 commentedon Nov 9, 2026
#1484's grill (
docs/grill-with-docs/1484-implement-suite.md, Q2.1, Q3.3, Q4.4) answered most of this issue:What's left here is the external-runner Arm: a pinned command that takes an Eval task's repository and Ticket and returns a branch, its session traces and their usage, for a process whose orchestrator is itself an agent.
docs/research/eval-process-arms-and-human-review.md§2 suggests shaping it like Harbor's agent interface, without taking Harbor as a dependency. It waits until an Experiment needs to compare thirdshift against an outside process.Stays
needs-triage, blocked by #1484.[-]Experiments: an external-runner Arm for processes thirdshift doesn't run itself[/-][+]Spec: Custom-runner Arms for process Experiments[/+]10 remaining items
JacobStephens2 commentedon Nov 14, 2026
This comment was generated by AI.
thirdshift's Run on this issue failed, so it waits for the Day shift.
issue-1468on origin, with pull request Spec: Custom-runner Arms for process Experiments #2203Put
ready-for-agentback to retry.JacobStephens2 commentedon Nov 14, 2026
This comment was generated by AI.
thirdshift's Run on this issue failed, so it waits for the Day shift.
issue-1468on origin, with pull request Spec: Custom-runner Arms for process Experiments #2203Put
ready-for-agentback to retry.Keep supervised failures failed and skip unknown events in web-search…