Skip to content
Nate G. / Vancouver, WA · US
all work
Open SourceAgentic AIDurable WorkflowsEvaluationTask Scheduling

Agent-Workflow

An experiment in durable coding-agent execution, evidence and acceptance, with an ongoing review of whether a second orchestration layer earns its complexity.

Case summary

Purpose

Agent work is hard to audit when status, evidence and acceptance live only in a chat or terminal. Agent-Workflow explored durable boundaries for these concerns. The current question is which boundaries need a separate harness when the coding agent already has one.

System

Agent-Workflow currently runs, records and evaluates coding-agent work through a separate workflow engine. Each Agent Run holds instructions, permissions, progress, saved evidence and review state. The architecture is now being audited against simpler agent-harness execution: the goal is to keep the useful evidence and recovery features without defending every existing layer.

Contribution

I designed the architecture, the rules for who may approve what, the evidence and review process, the limits on model decisions, the evaluations and the release criteria. Coding agents write the code and help review it, under my direction.

System diagrams

Each diagram links to its Mermaid source (a text format for diagrams) and has a static SVG version. They show how control and evidence move through the system. They illustrate the design and do not record real runs.

From an OpenSpec plan to two accepted tasks, a combined check and a separate merge step

Two tasks each run on their own, save a checked patch, and are reviewed and accepted separately. Agent-Workflow then combines both in a separate worktree and writes a new receipt. Merging and pushing are separate decisions.

From an OpenSpec plan to two accepted tasks, a combined check and a separate merge step: Two tasks each run on their own, save a checked patch, and are reviewed and accepted separately. Agent-Workflow then combines both in a separate worktree and writes a new receipt. Merging and pushing are separate decisions.From an OpenSpec plan to two accepted tasks, a combined check and a separate merge step: Two tasks each run on their own, save a checked patch, and are reviewed and accepted separately. Agent-Workflow then combines both in a separate worktree and writes a new receipt. Merging and pushing are separate decisions.

Drawn from merged Agent-Workflow pull requests #66, #73 and #75, plus the patch-collection fix in #77 (commit e93ccff3). This is a static SVG illustration. It is not Mermaid CLI output, a release sign-off or a merge receipt. The tested path combines exactly two single-commit tasks. A release-readiness check on a clean machine is still blocked.

Supporting architecture views 6 additional views

System diagrams

These diagrams show the architecture, who is responsible for what, and where evidence comes from, based on the project record. They describe the implementation and its stated limits. They are not independent test results.

01 / Execution path

How a request moves through Agent-Workflow

Workflow state is saved. Model workers act only within the instructions and permissions they are given.

  1. request
  2. planner and supervisor
  3. assign roles
  4. run in an isolated worktree
  5. save evidence
  6. separate review
  7. accept or reject

02 / Execution path

Resuming after an interruption

Saved runs, messages and evidence let work resume after an interruption. Review still happens separately.

  1. Fixed Agent Run instructions
  2. Worker step
  3. Messages and evidence saved
  4. Interruption or worker failure
  5. Resume from saved state
  6. Separate review: accept or reject

03 / Who controls what

Where each kind of work belongs

Rules handle facts and permissions. Models give structured advice on narrow judgment calls and do the open-ended generation.

Rule-based work (no model)

  • source version checks, input validation, permissions
  • saved state, process control, status changes
  • verification results, review gates, final accept or reject

Narrow judgment calls (structured advice)

  • classification and ranking
  • relevance, escalation, choosing a path
  • structured advice that application rules then act on

Open-ended model work

  • code generation and repair
  • debugging new problems and explaining causes
  • open-ended design work
More architecture diagrams 3 additional views

04 / Execution path

After import, Agent-Workflow runs the work and OpenSpec is not called again

OpenSpec 1.13.2 plans are imported into a fixed job format (native-job/v2). Each task is accepted separately, and the combined result gets its own check. Agent-Workflow then writes a receipt before any separate merge or push. The older native-job/v1 format is still supported.

  1. OpenSpec 1.13.2 plan
  2. Validate and hash the import
  3. Agent-Workflow job format (native-job/v2)
  4. Run, record evidence, evaluate, review, accept

05 / Feedback loop

Feedback loop

Benchmarks show where the workflow adds overhead or gets worse. Changes follow, and the same claims are tested again.

  1. add instrumentation
  2. benchmark
  3. diagnose
  4. simplify or optimize
  5. re-run benchmark

↻ The evidence feeds the next iteration.

06 / Execution path

Scoring after the outputs are locked

The planned BM6 study keeps task runs separate from the evaluator, which sees the outputs only after they are locked. This describes the method. No BM6 results are published.

  1. fixed task
  2. run both variants
  3. lock outputs (hash)
  4. bring in outside evaluator
  5. score the locked outputs

Engineering principles

Isolated side-by-side runs

Both setups get the same task and run separately, so each setup's results stay apart and clearly labeled.

Rules fixed in advance

Task, scoring and evaluator definitions are versioned. They are not changed after results are seen.

Results locked before scoring

Run outputs can be hashed and locked before any scorer sees them. If an output changes afterward, later scoring is invalid.

Inspectable outputs

Published studies include the finished software and cleaned-up evidence, so readers can inspect what was produced.

Problem

  • Agent work can disappear when a terminal, process or chat session ends.
  • Delegated work needs clear limits on what each agent may do, and its own copy of the source code.
  • An agent can finish its work without that work being reviewed or accepted.
  • Evidence, progress and the messages that steer a running agent must be saved, so a restart does not lose them and results can be replayed.

Technical Highlights

  • Agent-Workflow records each run's instructions, progress, and decisions, so work can resume after a process or terminal stops.
  • Coding agents work within defined permissions. Agent-Workflow controls review, acceptance, and what gets integrated or published.
  • The system keeps patches and review records. If Git patch collection fails or is incomplete, no patch file is written and the run cannot be used as final evidence.
  • One fixed OpenSpec plan (OpenSpec is a planning tool) can produce two isolated tasks, each a single commit. Each task is accepted on its own, then the combined result gets a new check. This two-task path is the one tested so far. Nothing schedules the tasks automatically, and publishing is a separate decision.
  • Published benchmark studies (BM4, BM5) report run time, token use, and automated score together. In BM4, Agent-Workflow scored higher than the direct baseline but took longer and used more tokens. In BM5, it ran faster and used fewer tokens but scored lower. Each study is one run (n=1), so neither shows that one setup wins in general.

System Design

  • Workflow → Task → Agent Run → Worker
  • The core (the main Agent-Workflow code) owns workflow state and run status changes. It also owns the built-in background workers. External workers connect through a separate interface that rejects calls from any worker that has since been replaced. Interactive display stays outside the core.
  • Normal delegation takes three steps: create a Git worktree (a separate working copy of the repository), write the run's fixed instructions and permissions, and launch the worker. It does not create a second set of run states.
  • OpenSpec 1.13.2, the planning tool, is imported into Agent-Workflow's own job format (native-job/v2). After import, OpenSpec is only a record of the plan. Agent-Workflow handles execution, evidence, review and acceptance, and makes no further OpenSpec calls.
  • Integration runs in an isolated worktree. It checks that exactly two accepted, single-commit runs are present, makes a new combined acceptance decision, and writes a receipt (task-integration/v1), a saved record of the result.

Rule-Based Control

  • Rule-based code, with no model involved, decides which workflow steps may run and keeps the workflow state.
  • It starts worker processes and supervises them within set limits.
  • It stores evidence and records each review, accept or reject change.
  • Accepting a task, accepting the combined result, replaying a run, and merging or pushing are four separate decisions. Agent-Workflow's own code makes each one.

Where Models Fit

  • Implementation and review workers may use coding models, within the instructions and permissions each run is given.
  • The optional built-in TypeSafe provider gives advice, recorded as evidence. It never changes workflow state.
  • TypeSafe answers three kinds of question. Choice picks one option from a list, Noul judges whether a statement is true, and Score rates something on an ordered scale. All three are advice only.

Failure and recovery

  • Messages and progress are saved before they are delivered live.
  • Archived inputs and Git bundles (single-file copies of repository history) let integration be replayed after the worker worktrees are removed. The combined result needs its own acceptance.
  • If Git patch collection fails, times out, is cancelled, or produces a truncated or oversized patch, no patch.diff is written. Diagnostics are saved, and the run cannot be used as final evidence. The earlier empty patch stays unchanged as a record.

Measured evidence

BM5 side-by-side development run

measured

-185.003 s run time · -235,308 tokens used · -2.5 automated-score points

One development run comparing two setups on the same task, a direct baseline and a slimmed-down workflow, using the published benchmark harness.

One pair of runs, and no pair has finished human review. It does not show a general effect or that either setup wins.

sample size: 12026-09-23source fafe862c0aa3
method and source

Benchmark studies

Each study runs two setups on the same task and publishes the finished software, scores, run time, token use and the study's limits. The results guide engineering work. They do not show that one setup wins in general.

BM5

Slimmed-down workflow

A side-by-side development study run after the optimization work. Both setups built the same Priority Picker app with the published benchmark harness. In the slimmed-down workflow, steering messages (instructions sent while the worker runs) guide the worker, and structured commands are used only in exceptional cases. Structured Direct is the baseline: a coding agent (Codex) run directly, without Agent-Workflow.

Structured Direct

Automated score
82.5
Run time (wall clock)
961.135 s
Tokens used
2,309,077

Agent-Workflow Slimmed

Automated score
80.0
Run time (wall clock)
776.132 s
Tokens used
2,073,769

Observed: In this one comparison, Agent-Workflow finished 185.003 seconds sooner and used 235,308 fewer tokens. Its automated score was 2.5 points lower.

One development run (n=1), and no pair has finished human review. It does not show a general effect or that either setup wins.

inspect study evidence
BM4

Optimized workflow study

A side-by-side development study of the first major Agent-Workflow optimization pass. It pointed the next round of work at verification and review overhead. Structured Direct is the baseline: a coding agent (Codex) run directly, without Agent-Workflow.

Structured Direct

Automated score
79.5
Run time (wall clock)
754.186 s
Tokens used
1,678,393

Agent-Workflow Optimized

Automated score
86.0
Run time (wall clock)
1,182.853 s
Tokens used
4,309,050

Observed: In this one comparison, optimized Agent-Workflow scored 6.5 points higher but took 428.667 more seconds and used 2,630,657 more tokens. The result pointed the next optimization round at verification and review overhead.

One development run (n=1), and human visual review is incomplete. The published study does not claim that either setup wins in general.

inspect study evidence

Finished benchmark apps

The benchmark repository publishes the finished applications and screenshots at each screen size for both setups, so readers can see how the two builds differ beyond their scores.

BM5

Structured Direct vs Agent-Workflow Slimmed

Both setups built the same Priority Picker app, and each finished app can be inspected on its own. Desktop screenshots are shown here. Tablet and mobile screenshots are linked for each setup.

Development benchmark evidence: one pair of runs, none with finished human review, and human visual review may still be pending. The screenshots are for inspection. They do not show which one looks better.

BM4

Structured Direct vs Agent-Workflow Optimized

BM4 also publishes desktop, tablet and mobile screenshots of both finished apps.

Development benchmark evidence. The screenshot setup has known limits, which the study records, and human visual review may still be pending. Read the screenshots alongside the study's scores and its notes on which runs qualified.

Evidence & documentation

Visitor analytics: page interactions, source category, browser information, and network IP metadata are recorded in private server logs. No analytics cookies are used. Opt out of future engagement beacons in this browser.