Skip to content

Research toward an open-ended goal

“Make query evaluation faster” names a direction without naming a solution. Getting there may take profiling, a new data structure, or several failed attempts before one pays off. Zdev’s research workflow keeps that exploration inside an agreed scope and records what each experiment actually showed.

This walkthrough uses a fictional query-evaluator repository where zdev is installed and an area named evaluation already exists. For a feature whose behavior is settled up front, follow A feature from idea to commit instead. You can run the terminal commands below yourself or ask your agent to run them and explain the output.

Start with exploration and discussion:

Use zdev to explore evaluation. We want query evaluation to be faster,
but do not know the right approach yet. Identify representative workloads
and help agree on correctness, compatibility, and measurement boundaries.
Do not start optimization experiments yet.

The first deliverable is a brief that pins down what counts as progress: for example, runtime on a fixed query set is the primary metric (lower is better), query outputs and public language semantics must stay unchanged, and specific trade-offs are acceptable or ruled out.

If the repository lacks a reliable benchmark, create and finish ordinary tasks to build one first. Then measure an actual baseline with the agreed correctness checks and representative inputs, and decide how repeated samples will be compared and how small a difference counts as noise.

Profiling can then turn that baseline into a testable hypothesis, such as “reusing an existing lookup result reduces repeated work on these queries.” Until the candidate has been measured, it remains a hypothesis.

Ask the agent to record the research settings for evaluation: the evaluator command, correctness commands, baseline samples, and comparison policy. Review those settings before authorizing experiments. While brief.md holds the broader rationale and boundaries, the research settings tell zdev how to run and compare measurements.

You can inspect the recorded settings without running the evaluator:

Terminal window
zdev area research evaluation

See the research reference for setup and execution details, and the task format reference for the exact fields.

Codex and Claude Code include built-in research execution routes. Once the area, policy, and baseline are in place, start a run with an explicit budget:

Use zdev to run serial research in evaluation within its brief, for
20 work attempts with a command limit of 100. Keep the agreed evaluator
and correctness policy.

This lets the coordinator propose and admit hypotheses and supporting tasks within the brief’s scope without stopping for bundle approval on each one, while leaving the product objective and agreed boundaries fixed.

Note that 20 work attempts does not mean 20 completed experiments. Preparation, supporting tasks, rework, failures, and interruptions all consume attempts, and evaluator and correctness runs draw from the separate command limit.

Before choosing the next step, the coordinator reads the accepted baseline and earlier lessons. For a hypothesis, it records the starting state, prepares a candidate, and runs the configured correctness checks and measurements.

Each attempt lands in one of four states:

Observation What happens
The candidate improves the metric under the policy and preserves correctness A fresh acceptance verifier checks it before its code is kept.
The candidate is valid but does not improve the metric The experiment finishes as rejected, records its evidence and lesson, and restores its owned changes.
The evidence is inconclusive or the experiment cannot run The record distinguishes that outcome from a valid comparison.
Work is interrupted before a terminal result The experiment stays open until it is recovered and resolved.

A rejected hypothesis still pays off when it rules out a dead end or exposes a bad assumption, keeping later sessions from repeating the same attempt. Zdev keeps the lessons in the task record, while Git retains accepted code and candidate refs for inspection.

Supporting tasks follow the normal implementation and verification path. After supporting code lands, or whenever evaluation conditions change, the run measures a fresh baseline before comparing more candidates so old measurements are never mixed with the new setup.

A research run stops starting new work when it hits its budget or target, when you interrupt it, or when a blocker prevents progress. It then reports the stop reason, accepted changes, rejected attempts, and remaining allowance. Reaching the budget simply ends the run; whether the wider objective is satisfied is still your call.

After an interruption, the summary might look like:

Stopped at your request; no new experiments started.
Accepted: one measured improvement, independently verified and committed.
Rejected: one candidate, with its changes restored and lesson recorded.
Allowance remaining: 12 work attempts and 64 evaluator/correctness commands.
Next: inspect the evidence and decide whether to resume this run.

In a real run, the report also includes the measured values along with any unfinished work or missing evidence. You can inspect the stored run state from the terminal at any time:

Terminal window
zdev research run evaluation context --format json

To pick up an interrupted run, ask:

Use zdev to resume the existing research run in evaluation.

Resuming keeps the run’s identity, scope, limits, and consumed allowance (it does not reset the budget), and checks for unfinished measurements or finalization before starting fresh work.

When the run finishes, weigh the evidence against the brief. The next move might be another bounded run, a focused ordinary task, a revised brief, or closing the area; even finding no worthwhile speedup is a result worth recording.

Once you are comfortable with serial runs, rolling research lets you overlap candidate preparation while keeping a separate cap on concurrent measurements:

Use zdev to run rolling research in evaluation within its brief, with
two workers and one measurement slot, for 20 work attempts.

Unlike an ordinary parallel task batch, a rolling research run keeps proposing scoped work as results arrive, and any candidate built on older accepted code is reconciled and remeasured before it can be kept. See Longer runs and orchestration for choosing the right form of continuation, and the research reference for support limits and recovery rules.