Research and experiments
For an introduction, read Research toward an open-ended goal. This reference covers the execution and record details.
Research areas can mix ordinary tasks and hypothesis tasks. Configure an open
area with zdev area research <area> --from <settings.json>, then review and
import hypotheses through the normal task-bundle workflow. Append measured
evidence with zdev task research <area> <task> --from <result.json>, or omit
--from to inspect settings or task evidence. The
research record contract
has the complete JSON formats and examples.
Hypotheses keep the normal open and done statuses. Interrupted evidence
leaves a hypothesis open, while accepted, rejected, inconclusive, and
failed-to-run evidence have distinct completion rules. A valid rejected
experiment can complete without improving the metric; completion does not
accept candidate code or close the area. The record commands validate supplied
evidence without launching evaluators, keeping or restoring code, or proving
recorded Git attestations. Codex and Claude Code install serial and rolling
research routes built on the managed local experiment commands. Ordinary
Implement, Plan, Verify, Parallel, and Loop routes stop before dispatching
hypotheses, while ordinary supporting tasks follow their normal workflow.
Serial research in Codex and Claude Code
Section titled “Serial research in Codex and Claude Code”First configure a research policy with actual baseline samples and a shell command for every required correctness check. The brief defines allowed changes, experimental reasoning, and measurement policy. Then explicitly authorize the installed skill, for example:
$zdev run serial research in work within the brief, for 20 work attempts$zdev run serial research in work until interrupted, with target 5 and command limit 100$zdev resume the existing research run in workState the scope and any attempt, command, cumulative command-time, or wall-time
limits. Without an attempt limit, the default run allows 20 coordinator work
attempts; specifying until interrupted or a wall-time limit removes that
default so a time-bounded run has no dispatch cap, while any other supplied
limits and the directional target still apply. This authorization lets the
coordinator generate supporting tasks and hypotheses inside the brief and
frozen policy without stopping to review every new bundle. Outside a run, task
creation still uses exact bundle approval unless you delegate creation and
import without confirmation.
The run records where each limit came from: user for a limit you stated,
default for a built-in default, and coordinator_estimate for a ceiling the
coordinator chose itself (such as a safety cap on command time); older runs
that predate limit provenance show unrecorded. The coordinator can raise its
own estimates without asking, but needs your grant to raise any other limit.
Progress reports count every dispatch as a work attempt and show separately how
many were measured experiments and how many were supporting work.
Before proposing work, the coordinator reads the accepted baseline along with
prior rejected, inconclusive, and failed lessons. It commits admitted task
records before candidate preparation. Supporting tasks use ordinary planning,
implementation, independent verification, and completion. Hypotheses use local
begin, evaluate, and finalize: the binary runs correctness and evaluator
commands, records samples and costs, keeps candidate Git references, and keeps
or restores exact owned files. Only a proposed keep gets a fresh independent
acceptance verifier; the coordinator checks discarded and terminal failed
results. Each completion creates its own commit and leaves the area open.
Preparation, supporting work, and same-task rework, repair, rerun, confirmation, reconciliation, and actual rebaseline consume allowance before work starts, and every correctness or evaluator invocation counts before launch. Failures and interruptions receive no refunds. Workers keep the concrete model and effort settings resolved for the run. Accepted supporting code or changed comparison conditions require a counted actual rebaseline. A shared environment blocker halts affected experimentation while allowing counted in-scope supporting repair; resolving it also requires a rebaseline.
Rebaseline normally refuses tracked changes and untracked files outside .zdev.
When commands write saved measurements to the same path repeatedly, declare
that path once as a generated output in the research settings (see
Declare generated outputs). For a one-off output,
name its path on the command instead, for example research run work rebaseline --run RUN --request baseline-1 --untracked-output results. Repeat
--untracked-output for extra repository-relative files or directories; these
add to the declared outputs for that request only. Either way, zdev preserves
those outputs without staging or ignoring them, while other untracked paths and
all tracked changes still block measurement. Name only generated output that
does not change the code being measured; this option is not evidence of
evaluator independence.
Inspect durable progress with:
zdev research run work context --format jsonzdev research experiment work work-001 inspect --format jsonzdev research experiment work work-001 recover --format jsonA new session recovers admissions, reservations, unfinished measurements, and finalization before dispatching anything new. Resuming preserves the original run ID, scope, target, deadline, and consumed resources, and does not relaunch unresolved measurements. Task records preserve measurements and lessons, and Git preserves accepted code and rejected candidates. If the prior conversation lacks concrete worker choices, the coordinator notes that and resolves fresh choices before dispatch.
Codex uses its exposed native goal tools for continuation while preserving any other unfinished goal. If native inspection is clear but creation is unavailable, it runs at most one foreground work-item iteration and reports that limit; uncertain native state blocks. It never claims background execution or marks an unfinished objective complete because of a transient blocker or an empty queue. A queue with no ready work allows more scoped proposals while allowance remains. Target, budget, interruption, and shared blocker each stop distinctly, and none closes the area or claims its optimization objective is achieved.
The installed Codex contract lists the
ordered coordinator operations. The installed Claude
contract uses
zdev-research with structured authorization, a fresh invocation identity, and
frozen concrete profiles. Pausing and continuing a live workflow is supported.
After a stop or failure, start a new resume invocation on the same durable run
because replaying a stopped script can replay a cached reservation before
restarting a worker. When packaged execution is unavailable, complete at most
one foreground work-item iteration and report the required continuation. Claude
does not use its separate /goal command for this route. Other harnesses
expose research records and local commands without this installed execution
route. Deterministic installation and command scenarios validate the contracts;
authenticated live Codex and Claude execution is separate acceptance work.
Extend an authorized run
Section titled “Extend an authorized run”When the user grants more allowance, extend the current run rather than ending it and starting another:
zdev research run work extend --run <run> --request another-day \ --add-time-seconds 86400 --add-attempts 20 --format jsonPass only the additions the user authorized. --add-commands and
--add-command-seconds raise the corresponding finite limits, and added time
extends the deadline even if it has already expired. Unlimited limits do not
need extending. Additions must be positive, counts cannot overflow, and time
must stay finite.
Keep the request identity: repeating it with the same additions is a no-op, while changing its additions is rejected. The run preserves its identity, scope, policy, target, consumed costs, active reservations, and checkpoints. Any interruption or shared blocker stays in place and must be resumed or resolved through recovery before dispatching more work.
Amend a correctness command path
Section titled “Amend a correctness command path”An active run freezes its correctness commands. If a file named by a command moves or is renamed while the check keeps the same meaning, declare the change administrative instead of ending the run. After editing the path in the settings file, run:
zdev area research work --from settings.json \ --administrative "Admission files moved to data/admission" --format jsonZdev accepts the settings only when they differ from the run’s frozen policy in
the command text of existing checks. Adding, removing, or renaming a check, or
changing any other field, is refused, as is an amendment while an experiment,
measurement, rebaseline, or acceptance is unfinished, or when the area has no
active run. The run keeps its ID, consumed costs, and comparison validity, and
research run work context lists each amendment’s reason along with its before
and after commands under run.amendments. Zdev runs nothing during
configuration; the next managed evaluate or rebaseline runs the amended
command.
Changing a horizon, workload, solver, or acceptance rule inside a command is a material change rather than an administrative one and requires a new study and a measured baseline.
Declare relevant inputs
Section titled “Declare relevant inputs”By default, any commit outside .zdev after the accepted baseline invalidates
comparisons and blocks begin, even a documentation edit. To narrow this, list
the files and directories that the evaluator, workload, and correctness
commands depend on in the research settings:
"relevant_inputs": ["src", "bench/workload.txt", "evaluate"]Entries are literal repository-relative paths outside .git and .zdev, where
a directory covers everything beneath it; globs are not supported. When in
doubt, list more rather than less so a real change cannot go unnoticed. Every
owned candidate path must fall inside the list, so begin and isolated admit
refuse a --path outside it. Spell each entry with the exact letter case Git
tracks, even on a case-insensitive filesystem, because a differently cased
entry matches nothing.
An active run freezes the list. To adopt or change it, end the run, update the
settings, and start a new run. Renaming a declared input also requires a new
run with an updated list because changes at the new name fall outside the
frozen list. When a declared input changes, run.invalidation records a
changed path and requires an actual counted rebaseline. Reconciliation of
isolated candidates still compares the whole repository, so a destination that
advanced only outside the declared inputs still reconciles and remeasures the
candidate.
Declare generated outputs
Section titled “Declare generated outputs”Evaluators often write captures into the repository. By default, any untracked
file outside .zdev blocks rebaseline as well as returning or reconciling an
isolated candidate. To keep captures in place, declare the output paths in the
research settings:
"generated_outputs": ["results", "logs/evaluator"]Entries follow the same path rules as relevant_inputs. Only untracked files
under these paths are tolerated; rebaseline and isolated return, evaluate,
reconcile, and integrate leave them untouched. Tracked or staged changes under
these paths still block, as do untracked files elsewhere and any .zdev edit.
Zdev never stages, cleans, or deletes declared outputs, and work-context
snapshots still include them. No directory counts as output because of its name
(such as results); only declared paths do.
Outputs must never contain anything a measurement consumes. When
relevant_inputs is declared, zdev area research rejects any output that
equals, contains, or lies inside a relevant input (case-insensitively). begin
and isolated admit refuse an owned --path under an output, and isolated
source admission still requires a clean new source worktree.
Changing generated_outputs during an active run invalidates comparisons until
a counted actual rebaseline, like any other evaluator or workload change; it is
never an administrative amendment. An isolated candidate admitted before the
change keeps its earlier outputs until reconciliation adopts the new settings,
so move untracked files under newly declared outputs out of its source before
reconciling. If accepted code changes a tracked path that overlaps a declared
output (the output itself, a path under it, or a replaced ancestor, compared
case-insensitively) while an isolated source holds untracked files under that
output, reconcile refuses rather than letting Git overwrite them; move the
source’s untracked output and run recover.
Rolling research in Codex and Claude Code
Section titled “Rolling research in Codex and Claude Code”Request rolling work and its capacities explicitly:
$zdev run rolling research in work within the brief, with two workers and one measurement slot, for 20 work attempts$zdev resume the existing rolling research run in workThis authorizes run-owned source worktrees within those limits (ordinary
Parallel keeps its finite-batch authorization). Each native planner,
implementer, verifier, and delegated finding checker consumes a counted
reserve --worker-slot claim. The coordinator respects the tighter of the run
and native capacities, refills slots as roles finish while siblings stay
active, and starts each source from the current accepted HEAD. One
measurement slot allows source preparation to overlap with one running
evaluator.
Returning sources enter a single destination acceptance lane, where stale
candidates reconcile and remeasure. The owner takes a counted confirmation role
for its fresh destination verifier. Checked rework uses a counted Prepare to
withdraw only that candidate’s integrated code back to accepted HEAD before
editing in the source worktree, leaving unrelated destination changes and
historical evidence intact. Recovery completes a recorded withdrawal without
authorizing another worker; repair requires fresh measurements, integration,
and independent verification.
Budget exhaustion, hitting the target, interruption, lost capacity, and shared failures each stop affected dispatch. Resuming preserves costs and deadlines and rechecks live worker and process ownership, keeping slots reserved for unknown workers or measurements. Shared condition changes or accepted supporting code require a counted actual rebaseline before paused candidates reconcile and measure. Required advanced plans and concrete worker settings stay fixed through rework and recovery, and missing evidence stops that candidate. Cleanup requires a stopped, durably completed, run-owned source and retained cleanup authority.
Claude Code uses its installed zdev-research workflow with execution set to
rolling along with worker_limit and measurement_limit at start (serial is
the default). Resume the same durable run with a fresh invocation_id and the
execution, cleanup, frozen_profiles, retained_plans, and
retained_candidates values from the prior report. All native roles consume
worker-slot claims, and asynchronous command mediation lets one evaluator
overlap source preparation. The workflow also counts every native call,
including mediation and ordinary helper calls, toward Claude’s documented
1,000-agent workflow cap; it stops refilling at 900 calls so active work can
drain and report cleanly. Continue with a fresh invocation rather than
replaying a stopped script, which cannot grant fresh dispatch permission.
Deterministic tests exercise the installed workflows against local public
commands, while credentialed Claude execution is separate live acceptance work.