One Loop, One Oracle

In roles modelled on human teams, my coding agents worked on reports and repairs while usable features at times hardly followed. In the loop, each session receives a user task, a scenario it cannot change and a budget. The merge gate alone marks a task as done against the running product. In three projects, the agents now work along a fixed structure, with executable evidence for every completed task.

FC
· 11 min read

Part 8 of 8 in the series The Agentic Engineering Pipeline for the SDLC

The earlier parts of this series organised the agents’ work on the model of a human development team, with fixed roles and a quality gate at every handover. In two projects, the agents wrote tests, revised checking scripts and submitted reports within that structure, while usable features at times hardly followed. In one of the projects, every approval rested on a written verdict that a language model gave about a diff, and at no point did a machine check against the running product whether a task was done. Of that project’s 87 user tasks, 78 had no clearly evidenced result. I examined the causes in my account of why my agentic SDLC stalled.

My agents now work in a loop made of a finite list of user tasks, one executable scenario per task that they cannot change, and a merge gate that alone marks a task as done. Each session receives one task, its scenario and a budget. Only a run of its scenario against the integrated product changes a task’s status. An agent’s work therefore has a checkable end and an upper limit on effort.

I use the loop for a command-line agent, a data ingestion pipeline and a strategy game. In these projects, agents work through user tasks, their changes enter the product after passing the checks, and every completed task has executable evidence behind it. The process transfers to other products. A human, the owner in my template, defines what the software should do. A lead agent organises the work, developer agents implement individual tasks, a test runner executes the scenarios against the running product, and the merge gate integrates the verified changes. The programming language, development tool and model are project settings.

Two columns. On the left the earlier process: roles hand over required artefacts, agents review agents in written reviews, a language model grants approval based on a diff, and done is the verdict in the report. 78 of 87 tasks had no clearly evidenced result. On the right the loop: a frozen task list with ratified scenarios, one session per task with a time budget, a merge gate that runs the scenario against the integrated product, and done is a passing run with commit and run log. At the bottom the human, who used to read reports and now ratifies scenarios and decides on parked tasks.
The same human, two processes. On the left the pipeline with the roles of a human team, on the right the loop, in which a run against the product decides what is done.

The result is a usable feature

A task describes an outcome from the perspective of someone using the product. It includes the required variants and the conditions under which the outcome must hold. The task is complete when the software meets these requirements and its scenarios pass against the integrated version.

The evidence covers the path from input to observable effect. In my command-line agent, live scenarios check responses and the effects of tool calls. In the data pipeline, database scenarios compare the source, raw data and history. In the strategy game, test drivers control the simulation and check a headless player build on macOS and Windows. The checks adapt to the product while the development process stays the same.

The method connects implementation with independent acceptance. The agent writing product code cannot change the approved expected results. The gate sets the task’s status from the executed test and records the checked commit and run log alongside it, so the result can be traced back to the same code later. The agent’s report helps with diagnosis.

Define the scope of a round

Work starts with a finite list of user tasks. In my template it is called feature_list.json. Each entry contains the desired outcome, required variants, affected interfaces and associated scenarios. A passes field records whether the task has passed acceptance.

The list stays fixed for one round. Additional requests go into a separate list so that ongoing work has a defined endpoint and new requirements do not displace tasks already agreed upon. The next round starts when the current tasks are complete or the owner has explicitly revised the scope.

Column chart with 14 columns from 1 to 11 October 2026. Each column shows the denominator of one pass of the strategy game, the green part the tasks that passed. Pass 1 on 1 October: 26 of 26. Pass 5 on 4 October: 50 of 50. Pass 9 on 7 October: 74 of 74. Pass 13 on 10 October: 91 of 91. As of 11 October: 93 of 100, seven tasks open.
Strategy game, 1 to 11 October 2026: the task list, the denominator in the chart, grew per pass only once all previous tasks were green. On 11 October, 93 of 100 tasks were green.

Before the first developer session, acceptance checks run against the existing product. This harvest run identifies functionality already present and includes it in regression testing. The agents start with the remaining tasks. When adopting an existing project, this preserves usable code and defines the remaining work as the difference between requirements and verified behaviour.

Make acceptance an executable oracle

An oracle compares observed behaviour with a defined expected result. It consists of scenarios with an initial state, inputs and checkpoints. A test driver runs them against the product and returns a machine-readable result. An existing test filter is enough for some tasks. Others need a driver for the user interface, database or simulation.

Scenarios are prepared before work on the product code begins. An agent drafts them from user tasks and acceptance criteria. The owner checks that they describe the desired functionality and approves them. This ratification determines what the developers will work towards and which result the gate may accept.

A good scenario also checks relevant failure cases. For a data export, for example, it could require the intended user to receive the correct data while an unauthorised request fails. This example combines usable functionality with its access requirements, which a check concerned only with successful execution could miss.

The known scenarios are supplemented by hidden variants with different inputs and the same checkpoints. These twins remain outside the developers’ working directories. If a twin fails while the known scenario passes, the owner investigates whether the implementation is tailored to the known inputs or the scenario itself needs correcting.

An incorrect expected result remains incorrect even when a test passes. Reviewing the scenarios against the product requirements is therefore part of the method. An owner who delegates this review to another agent defines its authority and checks samples personally. That is how I work in the game project: I define the game rules, and another agent reviews scenario drafts. Developers gain no authority to change their own acceptance checks.

Work through the loop

The loop repeats the same sequence for each approved task:

  1. A worker claims an open task. A lock prevents another worker from working on the same task at the same time.
  2. The worker starts in its own worktree from the current main branch. The session receives the task, its scenarios and a short progress note as its initial context.
  3. The developer works on product code within a defined time budget. The loop controller ends the session when the limit is reached. The lead agent watches the cost quota and stops starting workers at a defined threshold.
  4. The resulting branch enters the merge queue. The gate checks it against the current state of main.
  5. If the checks pass, the gate merges the change and marks the task complete. Otherwise, the task stays open and is parked for a decision, with a failure reason and run log.
The human ratifies scenarios. Up to four workers each claim a task with a lock file, work in a fresh session with three files of context for at most 60 minutes and put their branch into the queue. The merge gate is the only serial point: it restores denominator, oracle and loop from main, scans for secrets and runs scenarios, module tests and the smoke set. Green is fast-forwarded to main and sets passes, red is parked with a one-line reason and decided by the human in the evening. The nightly run checks green scenarios and sealed twins against the product target and resets regressions.
The loop as of 26 September 2026: four workers in parallel, one queue, one serial gate, and the regression run at night.

Each new session starts with fresh context. The repository holds the code, while the progress note records the findings needed to continue. A new attempt therefore does not depend on a long conversation whose assumptions and intermediate states the next agent would have to reconstruct.

Several workers can handle independent tasks in parallel. Integration into main is serial, so every change is checked against a version that already includes the changes merged before it. A worker’s tool and model can change without altering the expected results or acceptance rules.

The gate protects the shared product

The merge gate takes a branch from the queue and rebases it onto main. It takes the task list, scenarios and loop tooling from the trusted main branch. Any developer changes to these files are reset before testing. Tool-level write protection and a comparison of protected paths after each session provide additional checks.

The build, task scenarios and tests for affected modules then run. A small smoke set checks core functionality. Invariant tests check properties that apply across the product, and the diff is scanned for credentials and prohibited test changes. The gate performs a fast-forward merge only when the required checks pass.

Developers are prohibited from deleting, weakening or skipping existing tests. The gate parks a branch as soon as a line in a test file has been removed or changed or the diff introduces a skip marker, and it uses the invariant tests from main. This check only detects changes to existing tests. Whether the product delivers the desired functionality is still established by the protected acceptance scenarios and the hidden variants.

A nightly regression run rechecks accepted tasks. If a feature loses its expected behaviour, the nightly run resets its status and places it ahead of the other open tasks. The hidden variants run as part of these checks. In the game project, the gate also checks previously passing scenarios that use the same test driver before merging another change.

Five building blocks. The trusted zone, written only by the human and the gate, holds a fixed denominator of user outcomes and an executable oracle ratified by the human, with a sealed twin. The agent workspace runs stateless sessions with minimal context and hard limits. A serial point of entry on the boundary takes oracle and denominator from the trusted state and is the only one that sets done. Feedback from the regression run and the board goes to the human.
The generalised model. The point of entry sits on the boundary between the trusted zone and the agents' workspace.

Responsibilities and decisions

The owner is responsible for the product goal and acceptance against its requirements. They decide on scope changes, parked tasks and external actions such as pushing or publishing. Time and cost limits are set before a run. The session length depends on the project and how long its checks take.

The lead agent prepares the next work. It drafts scenarios, starts workers and keeps the documentation aligned with the product. Developers work on their branches. The gate checks and integrates their results. This division of responsibilities requires no particular model family, provided the tools support the necessary access and protection rules are enforced outside the developer session.

For a parked task, the owner decides whether to attempt it again, split it, correct the scenario’s requirements or move it to a later round. A further attempt therefore has a reasoned assignment. The original user outcome remains open until it is fulfilled or explicitly changed.

This division replaces the roles of the earlier pipeline. There, agents assessed other agents’ work in written reviews, product owner agents were responsible for their own assignments, and a coordinator merged their results. Errors led to new rules, and together these produced assignments that could be worked on for a long time without bringing the product closer to a usable state. In the current process, each worker follows a task whose completion the gate establishes against the product. A gain in speed over the previous process has yet to be demonstrated.

Agents and models in use

These are the role assignments in my projects as of 11 October 2026. As the owner, I define the product goal and the agents’ authority. The working instructions call the lead agent “Root”.

Role and projectAgent toolModel
Lead agent in all three projectsClaude CodeMostly Claude Opus 5.5, with Claude Fable 5.1 used at times in the strategy game
Developer for the command-line agentClaude Code, Muse CodeClaude Opus 5.5 and Muse Spark 1.3, respectively
Developer for the data pipelineGitHub Copilot CLIInitially gpt-6-sol, then gpt-6.1-sol with high reasoning effort
Developer for the strategy gameClaude Code, Muse Code, Antigravity CLI agy, Codex CLIClaude Opus 5.5, Muse Spark 1.3, gemini-3.8-flash-high and gpt-6-astra, respectively

Root drafts scenarios and starts developer sessions, with their command-line tool and model configured in the loop controller. In the strategy game, Root also performs the delegated review of scenario drafts written by another agent. The merge gate and test runner perform acceptance checks as programs without a language model.

The command-line agent also has a model inside the product under test: its live scenarios initially ran against gpt-5.6-sol, later against GLM 5.3 through OpenRouter. That model produces the product responses checked by the oracle. It does not decide whether the developers’ work passes acceptance.

Adopt the method in a project

Adoption requires acceptance scenarios and a connection to the project’s build and test environment. The loop itself is reusable. My template exposes three configurable commands: build, module tests and oracle. The oracle accepts --ids and --out, exits with code 0 only on success and writes a report.json with exactly one entry per requested task ID.

Start with a small, complete user task. Its scenario follows the intended path through the product. Once the runner can check that path, further tasks can be added in the same way. If an interface lacks a test driver, building one is part of setting up acceptance.

For an existing repository, first preserve the usable product state and any unfinished branches. The branches go through the gate, then the harvest run checks the approved scenarios. The loop starts with tasks that do not yet pass. New requests go into the next round.

For products with variable model responses or demanding environments, checks can be divided into two levels. A deterministic run against the local product determines passes. An additional reference run examines behaviour under realistic conditions, such as actual data volumes. Its results remain separately visible because local acceptance establishes only the properties checked there.

The working instructions describe responsibilities and point to executable controls. In my template, a script limits their length so that individual cases do not keep adding new rules. Run logs connect worker, gate and oracle through a shared trace ID. An optional adapter then copies the confirmed status into an existing ticket system and reads it back for verification.

The task list and work in fresh sessions draw on Justin Young’s Effective harnesses for long-running agents. Locks for parallel workers come from Nicholas Carlini’s work on a C compiler with Claude. My method combines these components with protected oracles, approval of the expected behaviour and the merge gate as the sole route to integrated, accepted functionality.

AI Agentic Coding Software Engineering SDLC Human in the Loop