Skip to content

Deterministic goals across harnesses

zdev goal renders an area continuation condition in native_goal, alongside the current task context. The CLI builds the condition deterministically from the area tag and explicit run options, so task selection, completion, and changing task details leave the condition unchanged.

Pass the condition unchanged when creating a native goal, and keep selected task IDs, snapshots, worker settings, and progress in the conversation. Area records supply the current objective and boundaries, and each worker reads its own task record. A run ends at queue exhaustion or area closure. A confirmed blocker or required user decision pauses the goal where the agent can pause it (Codex, including Codex in T3 Code), so /goal resume continues once the cause is resolved; elsewhere the report ends the run. Ending or pausing a run preserves unfinished tasks and leaves the area open.

zdev goal <area>
zdev goal <area> --format json
zdev goal <area> --focus "payment retries" --parallel --format json
zdev goal <area> <area>... [--focus <text>] [--parallel]
zdev goal --all [--focus <text>] [--parallel]

At least one <area> or --all is required. The sections below cover the single-area projection; Several areas covers multi-area and --all invocations. Unlike zdev next, zdev goal does not infer a default area and does not require a clean branch or a task-work branch. It reads and validates records without modifying files, Git state, or a harness session.

--focus carries the user’s selection guidance into the condition without selecting a task during this read-only command. --parallel renders four independent task slots using worktrees, with serial integration and per-task verification and commits. Otherwise the condition keeps any explicit workspace choices and falls back to workspace.branching (current checkout by default). Explicit worker choices stay in effect. Ordinary invocation renders sequential continuation. These flags describe a run; they do not create workers or workspaces or authorize execution.

The projection reads only current .zdev records:

  1. area.toml: tag, title, objective, and lifecycle.
  2. Every task header in the area (id, key, status, slice, and blocked_by), plus complexity, AFK suitability, priority, the task title, and the Outcome, optional Context, optional Boundaries, Done when, and Validation sections.
  3. If the selected task names a slice, that slice’s key, title, Objective, and Boundaries.

The area branch, parent, and base_commit fields describe workspace topology rather than intent and are excluded. Free-form area-brief sections are also excluded because the area metadata objective is the structured source for this projection; the full area brief is still required reading before implementation. Task result text and done-task details are excluded as well.

The command uses zdev’s strict record parsers and validators and rejects malformed input rather than producing a partial goal.

The top-level lifecycle is the durable area value, open or closed. The derived queue is one of:

  • ready: at least one open task has no unfinished blocker. task is the first such task.
  • empty: the area has no tasks. task is null.
  • blocked: open tasks exist, and every one waits on a task in another area that is not done in the current checkout. task is null, and cross_area_waits lists each wait as a {task, blocker} object.
  • exhausted: tasks exist and all are done. task is null.

A closed area reports queue: empty or queue: exhausted according to its records and never selects a task.

Task selection orders by AFK suitability, priority, and numeric ID, with the full ID as tie-breaker. Each blocked_by array keeps its authored order, and the associated slice is read by key. No filesystem order, clock, current branch, harness, model, or Git status affects the output.

Within one area, a validated acyclic graph with an open task always has at least one task whose same-area dependencies are done. That task is ready unless it waits on another area. When every open task waits on another area, zdev goal exits 0 with queue: blocked and human output names each wait as <task> blocked by <id> (<area>: <status>). Missing blockers, cycles, and malformed graphs fail graph validation before the queue is projected.

The counts are always present in the order total, open, ready, blocked, done and cover all tasks in the area, not only the selected task.

  • task is always present and is null unless lifecycle is open and queue is ready.
  • native_goal is present only for ready.
  • slice is omitted from the task when the task has no slice.
  • context and task boundaries are omitted when their Markdown sections are absent. A present validated section is emitted even if another section has the same text.
  • Slice files not attached to the selected task are omitted. A slice is context, not executable work, so an area with slices but no tasks is still empty.
  • Human output follows the same rules and prints no empty headings, null, or placeholder slice text.

Markdown section values are trimmed the same way the task and slice parsers trim them, preserving bullet and checklist markers so proof conditions are not reinterpreted.

For the same validated records and zdev version, both formats are byte-for-byte stable and end with one newline. JSON key order follows the examples below, pretty-printed with two-space indentation.

Assume checkout contains three tasks. checkout-001 is done, checkout-002 is ready and belongs to the payments slice, and checkout-003 is blocked by checkout-002.

Area: checkout — Checkout reliability
Lifecycle: open
Queue: ready
Objective:
Make checkout failures safe and understandable.
Counts: 3 total; 2 open; 1 ready; 1 blocked; 1 done
Task: checkout-002 — Reject duplicate payment submission
Complexity: standard
Task source: .zdev/checkout/tasks/002-reject-duplicate-payment.md
Outcome:
A repeated submission returns the original payment result without charging again.
Context:
The provider can retry after losing our first response.
Slice: payments — Payment submission
Slice source: .zdev/checkout/slices/payments.md
Slice objective:
Make payment submission safe to retry.
Slice boundaries:
- Do not change provider selection.
Boundaries:
- Keep the public response schema unchanged.
Done when:
- [ ] Duplicate provider calls are prevented.
- [ ] The original result is returned.
Validation:
- Run the focused payment integration test.
Native goal:
Continue zdev area checkout. Read .zdev/checkout/area.toml and .zdev/checkout/brief.md for the current objective and boundaries. Run the installed one-task implementation contract, independently verifying and committing each task before selecting again. Retain the run's workspace and worker choices; with no workspace choice, follow workspace.branching (current checkout by default). Let fresh work-context select the next task. Refresh repository state after each commit. Continue while the area is open, work is ready and safe, and the work remains authorized. Ordinary dispatch stops before hypotheses. Finish when fresh context is closed or the queue is empty, blocked or exhausted. On a confirmed blocker or required user decision, report its reason and preserved state, then pause this goal as requested here so resuming it continues the run; where the agent cannot pause it, that report finishes the run. Settle owned workers before finishing; preserve unfinished work and area lifecycle.

The native condition uses a fixed template in src/goal.rs. It contains no task or slice details. Paths are repository-relative and use / separators.

{
"schema_version": 1,
"area": {
"tag": "checkout",
"title": "Checkout reliability",
"objective": "Make checkout failures safe and understandable.",
"path": ".zdev/checkout"
},
"lifecycle": "open",
"queue": "ready",
"counts": {
"total": 3,
"open": 2,
"ready": 1,
"blocked": 1,
"done": 1
},
"task": {
"id": "checkout-002",
"key": "reject-duplicate-payment",
"title": "Reject duplicate payment submission",
"complexity": "standard",
"path": ".zdev/checkout/tasks/002-reject-duplicate-payment.md",
"outcome": "A repeated submission returns the original payment result without charging again.",
"context": "The provider can retry after losing our first response.",
"boundaries": "- Keep the public response schema unchanged.",
"done_when": "- [ ] Duplicate provider calls are prevented.\n- [ ] The original result is returned.",
"validation": "- Run the focused payment integration test.",
"blocked_by": [],
"slice": {
"key": "payments",
"title": "Payment submission",
"path": ".zdev/checkout/slices/payments.md",
"objective": "Make payment submission safe to retry.",
"boundaries": "- Do not change provider selection."
}
},
"native_goal": "Continue zdev area checkout. Read .zdev/checkout/area.toml and .zdev/checkout/brief.md for the current objective and boundaries. Run the installed one-task implementation contract, independently verifying and committing each task before selecting again. Retain the run's workspace and worker choices; with no workspace choice, follow workspace.branching (current checkout by default). Let fresh work-context select the next task. Refresh repository state after each commit. Continue while the area is open, work is ready and safe, and the work remains authorized. Ordinary dispatch stops before hypotheses. Finish when fresh context is closed or the queue is empty, blocked or exhausted. On a confirmed blocker or required user decision, report its reason and preserved state, then pause this goal as requested here so resuming it continues the run; where the agent cannot pause it, that report finishes the run. Settle owned workers before finishing; preserve unfinished work and area lifecycle."
}

These are successful observations with exit code 0, not errors:

  • open / empty means that no tasks are recorded and the objective remains open.
  • open / exhausted means that tasks exist and all are done, but the area has not been explicitly closed.
  • closed is an explicit lifecycle decision, not a synonym for queue exhaustion.

The following fixtures define their complete byte-level output, including the area header, objective, counts, blank lines, key order, and final newline.

Area: general — General improvements
Lifecycle: open
Queue: empty
Objective:
Capture small approved improvements without inventing a product roadmap.
Counts: 0 total; 0 open; 0 ready; 0 blocked; 0 done
The open area has no tasks. Create and approve a task, or close the area.
{
"schema_version": 1,
"area": {
"tag": "general",
"title": "General improvements",
"objective": "Capture small approved improvements without inventing a product roadmap.",
"path": ".zdev/general"
},
"lifecycle": "open",
"queue": "empty",
"counts": {
"total": 0,
"open": 0,
"ready": 0,
"blocked": 0,
"done": 0
},
"task": null
}
Area: release-notes — Release notes
Lifecycle: open
Queue: exhausted
Objective:
Keep shipped behavior documented for users.
Counts: 2 total; 0 open; 0 ready; 0 blocked; 2 done
The open area's task queue is exhausted. Add approved work, reopen a task, or close the area.
{
"schema_version": 1,
"area": {
"tag": "release-notes",
"title": "Release notes",
"objective": "Keep shipped behavior documented for users.",
"path": ".zdev/release-notes"
},
"lifecycle": "open",
"queue": "exhausted",
"counts": {
"total": 2,
"open": 0,
"ready": 0,
"blocked": 0,
"done": 2
},
"task": null
}
Area: release-notes — Release notes
Lifecycle: closed
Queue: exhausted
Objective:
Keep shipped behavior documented for users.
Counts: 2 total; 0 open; 0 ready; 0 blocked; 2 done
The area is closed. Reopen it before adding or selecting work.
{
"schema_version": 1,
"area": {
"tag": "release-notes",
"title": "Release notes",
"objective": "Keep shipped behavior documented for users.",
"path": ".zdev/release-notes"
},
"lifecycle": "closed",
"queue": "exhausted",
"counts": {
"total": 2,
"open": 0,
"ready": 0,
"blocked": 0,
"done": 2
},
"task": null
}

No native condition is generated for no-work states. An adapter reports the lifecycle and queue and stops rather than inventing work from an area objective or an unattached slice.

zdev goal <area> <area>... covers the named areas in the order given, while zdev goal --all covers every area in tag order. Each area is read and validated the same way as a single area; any failure fails the command. JSON output has this shape:

{
"schema_version": 1,
"scope": "areas",
"areas": [
{
"tag": "checkout",
"title": "Checkout reliability",
"path": ".zdev/checkout",
"lifecycle": "open",
"queue": "ready",
"counts": { "total": 3, "open": 2, "ready": 1, "blocked": 1, "done": 1 },
"task": {
"id": "checkout-002",
"title": "Reject duplicate payment submission",
"complexity": "standard",
"path": ".zdev/checkout/tasks/002-reject-duplicate-payment.md"
}
}
],
"ready_areas": ["checkout"],
"native_goal": "Continue zdev areas checkout, docs (the covered areas). ..."
}

scope is all for --all and areas otherwise. task is null unless the area is open with a ready queue, and cross_area_waits appears for any area whose open tasks wait on other areas. ready_areas lists the areas with a ready task in covered order, and native_goal is present only when ready_areas is non-empty. Human output starts with Areas: and Ready areas: lines, lists each area with its lifecycle, queue, counts, and next task, and ends with the condition or No covered area has ready work.

The condition names the covered areas, or every open area for --all. Before each task it picks the first covered area whose fresh work-context is open, ready, and safe (in the listed order for named areas, or tag order for --all), and that area’s work-context selects the task. With --focus, the coordinator instead ranks the combined ready frontier across the covered areas. The run skips covered areas that are closed, empty, blocked, exhausted, or unsafe for the checkout, reporting why, and finishes when no covered area has ready, safe work. A confirmed blocker or required user decision pauses or ends the run just as it does for one area.

The installed skills apply this condition directly. Codex uses get_goal and create_goal, and Oh My Pi uses its goal tool, each preserving any different unfinished goal. Claude Code has no goal operation the model can call, so the skill prints /goal <condition> in a code block for the user to enter. OpenCode and Pi show the bare condition. In T3 Code the condition keeps the Use zdev with T3 orchestration. prefix.

Missing repositories or areas, unreadable files, invalid schemas, malformed Markdown sections, invalid dependencies, and missing referenced slices are command errors. Text mode writes error: ... to standard error; JSON mode uses zdev’s error envelope with schema_version, command, ok: false, and error. Both exit nonzero without emitting a success payload.

A missing blocker or dependency cycle fails graph validation. If open tasks remain with no ready task and no cross-area wait explains it, that signals a malformed internal projection and fails as an error rather than being rendered as blocked.

Failure never mutates state: zdev goal does not acquire a write lock, repair an index, create a task, update status, touch Git, or call a harness. An adapter parses a complete, successful JSON document before sending any prompt or native-goal command; on command or parse failure it leaves the current session goal unchanged and reports the error.

Harness Native capability zdev integration point
Codex Codex has a session goal command. /goal <objective> sets a goal, /goal shows it, and edit, pause, resume, and clear manage it. The objective is limited to 4,000 characters. The feature can be disabled, so it is not universally available. Codex also loads reusable SKILL.md workflows. See Codex developer commands, goal use case, and skill documentation. The installed continuation skills use model-callable get_goal and create_goal; they do not try to enter interactive composer commands. Ordinary task work uses the complete validated work-context.
Claude Code /goal keeps a session running until a model judges a completion condition satisfied. One goal can be active; setting another replaces it. An active goal is restored on session resume, and conditions are limited to 4,000 characters. The evaluator reads the transcript but does not run tools. Plugin skills are namespaced, invocable workflows. See Claude Code goal documentation and skill documentation. /zdev:zdev-loop and /zdev:zdev-goal run the same standalone area workflow; /zdev:zdev-implement remains one task. Zdev’s workflows do not inspect or apply Claude Code’s separate /goal command.
OpenCode Custom commands expand a Markdown body into a prompt and accept arguments, shell output, and file references. Built-ins include /init, /undo, and /share, without a native session-goal lifecycle. OpenCode separately persists and resumes sessions. See OpenCode commands and OpenCode CLI sessions. The packaged /zdev-implement <area> command, or the zdev skill directly, runs zdev work-context <area> --format json. It cross-validates the nested goal and status projections with HEAD and exact Git evidence, then supplies the complete context to ordinary task work. No goal emulation or extra state is needed.
Pi Pi prompt templates are Markdown expanded into ordinary prompts and invoked as /name; project templates live under .pi/prompts/. Skills are loaded on demand and can be invoked as /skill:<name>. Sessions are persisted as JSONL and can be resumed, without a native goal lifecycle. See Pi prompt templates, Pi skills, and Pi sessions. The packaged /zdev-implement <area> prompt or zdev skill runs zdev work-context <area> --format json. It cross-validates the nested goal and status projections with HEAD and exact Git evidence, then uses the complete context for ordinary task work.
Oh My Pi Oh My Pi has a persistent goal runtime. Its create operation refuses to overwrite an unfinished session goal; the runtime supports pause, resume, drop, completion, accounting, and autonomous continuation. Interactive /goal set <objective> creates a goal, while /goal show, pause, resume, and drop manage it. See Oh My Pi goal runtime, interactive goal command, and goal continuation prompt. The installed continuation prompts use the model-facing goal tool with get, create, and same-goal resume; they never invoke the interactive composer. Ordinary task work uses the complete validated work-context.

Plugins may add further capabilities. Skills, commands, and prompt templates are enough for zdev’s workflow, so zdev does not emulate a native goal.