Repeatable instructions
YAML stores prompt IDs, instructions, repository location, routing, verification commands, and limits in a reviewable file.
Engineering case study · Controlled agent execution
Local engineering infrastructure for repeatable coding-agent work: explicit YAML tasks, verified attempts, persistent state, and review decisions before a folder pipeline moves forward.
Source-reviewed at commit 4b82cba (opens in a new tab). Implementation evidence, not a production benchmark.
Repeatedly copying instructions into an agent leaves the operator to track which task ran, which provider handled it, what changed, and whether a failed check was ever repaired. Interruptions turn that informal process into a recovery problem.
AgentBatchRunner makes that work explicit. A batch runs prompts sequentially; the shared core records each attempt and executes the configured verification commands. Folder pipelines add ordering, dependency checks, review artifacts, and next-file decisions.
YAML stores prompt IDs, instructions, repository location, routing, verification commands, and limits in a reviewable file.
A retry includes the original task and the failed command, exit code, output, and timeout details instead of a context-free “try again.”
JSON state and Markdown reports preserve the task, provider, attempts, and result for the next operator decision.
Batch execution and artifact boundaries (opens in a new tab)
PromptFileLoader, EffectiveAgentPolicy, and executable preflight resolve valid work and providers.
BatchRunner asks GitCheckpointManager to record the starting Git state and create a branch reference.
IAgentAdapter dispatches Claude Code, Codex CLI, or the built-in dry-run adapter.
VerificationRunner executes configured shell commands and returns their results to the retry loop.
RunStateStore persists configuration, routing, task and attempt JSON. ReportGenerator produces the run summary and final Markdown report. Events feed the GUI.
PipelineFolderRunner wraps batch execution. PipelineReviewRunner produces review evidence; NextPipelineFileSelector applies eligibility and advancement rules.
YAML validation and executable preflight happen before task checkpoints. Labels below use the real RunStatus values; invocation and verification are operations within Running.
PendingTask announced in the configured sequence.
RunningCheckpoint → agent invocation → configured verification.
SucceededAgent succeeds and all configured verification commands pass.
UnverifiedSuccessAgent succeeds with no verification commands. Explicitly weaker than verified success.
Failed → retryA failed attempt feeds diagnostics back into the next invocation while the normal attempt budget remains.
NeedsHumanReviewNormal attempts are exhausted. The failed attempt history and final diff remain available.
Stop paths: RateLimited without an eligible fallback, ToolchainFailure, and explicit Blocked, NeedsHumanDecision, PrerequisiteMissing, or Canceled outcomes are handled separately from ordinary verification retries.
NeedsHumanReview does not itself halt the remaining prompts in a plain batch. Folder orchestration evaluates the batch outcome before advancing to another file.The happy path uses PipelineFileStatus, a separate model from individual task status.
PendingDiscovered in the queue.
EligibleDependencies, gates, and agent availability allow selection.
RunningThe selected YAML batch executes.
ExecutionSucceededBatch has Succeeded or UnverifiedSuccess outcomes.
ReviewingA separate agent invocation produces review artifacts.
ApprovedParsed review approves the file; next-file rules still apply.
CompletedWithoutReviewIf review is not required, execution follows this branch and the next-file decision requires confirmation.
ApprovedWithWarningsDoes not auto-advance by default. The core exposes a separate policy option for allowing warnings.
ReviewFailed / BlockedInvalid review evidence or blocking findings prevent normal advancement. Other explicit stop verdicts retain their own status.
Approved review is machine-produced evidence. It is not proof that a person reviewed the code, nor is ExecutionSucceeded proof that verification commands existed.project: Sample.Repository
repoPath: C:/work/sample-repository
defaultAgent: codex
defaultMaxRetries: 2
autoSwitchOnRateLimit: false
prompts:
- id: P001
title: Add a focused regression test
prompt: >
Add a test for the documented edge case.
Preserve existing public behavior.
verify:
- dotnet build
- dotnet test
maxRetries: 2
agentTimeoutSeconds: 1800
verifyTimeoutSeconds: 900promptrepoPathverifydefaultAgent / agentmaxRetriespipeline metadata defines dependency, review, gate, and next-file rules.The runner executes the configured commands in order, captures stdout, stderr, exit code, duration, and timeout information, and stops at the first failed command.
A failed agent invocation or verification command becomes retry feedback. Output in that feedback is capped at the last 24,000 characters.
An empty verification list becomes UnverifiedSuccess. It is not silently relabeled Succeeded, but plain-batch resume still treats it as a completed task.
Before a task, the runner creates an agentbatchrunner/... branch at the current HEAD without checking it out. It records Git status, saves an initial unstaged diff when dirty, and later captures a final unstaged diff. It does not auto-commit, reset, or restore the worktree.
The CLI loads the normalized config and run summary, restores routing, skips Succeeded and UnverifiedSuccess tasks, and appends attempts for remaining work. Existing checkpoint references and attempt folders are retained.
.agentbatchrunner/runs/<run-id>/
run-config.normalized.json
run-routing.json
run-summary.json
final-report.md
tasks/<task-id>/
checkpoint.txt
status.json
git-diff-before.patch
git-diff-after.patch
attempts/attempt-N/.agentbatchrunner/pipelines/<run-id>/
pipeline-state.json
pipeline-summary.json
pipeline-report.md
queue.json
execution-diffs/
generated-reviews/
review-runs/
reviews/Representative paths from the source. These are an artifact map, not captured run results.
A checkpoint is not a complete backup. A branch references a commit; plain git diff does not capture staged changes or untracked file contents. Partial agent edits remain in place, including after a provider switch. An interrupted execution with no run summary requires inspection rather than a silent replay.
Explicit CLI --agent or GUI global override.
The individual task's agent value.
The batch's defaultAgent.
No implicit provider when all three are absent.
Claude Code and Codex are invoked as local CLIs. The dry-run adapter records the prompt without calling either provider; configured verification commands and runner Git/state operations still run.
Automatic rate-limit fallback is off by default. Configured fallbacks must pass executable preflight. Manual pending switches apply at prompt boundaries and do not interrupt the current process. Cross-provider switches start a fresh session and retain the current worktree.
Reports distinguish configured, base, effective, and attempt agents. Rate-limit attempts do not consume the normal attempt budget; provider switches have their own limit. Switching providers can change data handling, cost, and output behavior.
The folder runner separates execution results, review verdicts, dependency satisfaction, gate decisions, and next-file selection. A person chooses the mode, reviews the evidence, and decides how to resolve blockers.
Run the selected eligible file and stop at the boundary.
Execute and review one file, then pause for approval to run the next recommendation.
Requires an allowed review verdict, canAutoAdvance, an eligible next target, and policy checks. Automatic transitions are capped at 20 by default.
SkippedByUser does not satisfy a dependency or gate.Approved can come from the review agent. Auto Advance does not require a human click at every boundary, and a plain batch has no per-task approval gate.Eligibility and advancement policy (opens in a new tab)
Confirmation, manual-action, and gate tests (opens in a new tab)
dotnet run --project src/AgentBatchRunner -- validate prompts.yaml
dotnet run --project src/AgentBatchRunner -- run prompts.yaml
dotnet run --project src/AgentBatchRunner -- resume --run-id <run-id>
dotnet run --project src/AgentBatchRunner -- report --run-id <run-id>The folder command adds planning, running, status, resume, reporting, and manual queue actions. CLI validation checks configuration; execution performs agent preflight.
The Batch File tab exposes YAML selection, validation, routing, Run/Cancel, live logs, task diagnostics, and report links. The Folder Pipeline tab exposes the queue, execution/review agents, dependencies, gates, next-file approval, pause/stop, and manual status actions.
GUI validation includes executable preflight. The global routing selector is disabled during execution; pending-agent switches are handled separately.
Interface descriptions are verified from code. No screenshots, video, or recorded run logs were found in the inspected repository; no simulated screenshot or live-demo claim is presented.
The process runner attempts process-tree termination, records exit code 124, and feeds the failed attempt into normal retry handling. Detached children may require manual cleanup.
Each failed check is saved with its output. Exhausting normal attempts produces NeedsHumanReview. It does not trigger an automatic Git reset.
Stop as RateLimited, or use an available, preflighted fallback when explicitly enabled and within the switch limit. Old attempts remain; the replacement provider starts fresh.
Preflight blocks invocation before checkpoints. A detected runtime toolchain failure is non-retryable and untouched prompts are marked Skipped.
Malformed/mismatched review JSON or a detected product Git-state change becomes ReviewFailed. Changes are preserved for inspection, not reset.
Existing artifacts support diagnosis and boundary-based resume when a summary exists. A missing summary or failed branch creation requires operator inspection; there is no automatic conflict-resolution or rollback engine.
Process timeout and cancellation handling (opens in a new tab)
Verification uses PowerShell on Windows and /bin/sh elsewhere. repoPath is a working directory, not a filesystem sandbox. Review YAML and commands before execution; the runner is not an untrusted-code execution service.
The published defaults use Claude acceptEdits and Codex workspace-write. Folder reviews request Claude plan or Codex read-only and compare product Git state before/after. These controls rely on external CLI behavior and do not prove OS-level isolation.
Pattern-based redaction exists for selected secret-like strings. Prompts, configuration, logs, state, and reports are local files; the patterns do not guarantee complete secret removal. Provider authentication remains with the installed CLIs.
The checkpoint service creates branch references and captures status/diffs. It does not auto-commit, reset, delete product files, or force-push. Invoked agents and verification commands can still modify the working tree.
The CLI refuses administrator/root execution. This is a verified CLI check, not a claim that every entry point or child process is universally sandboxed. Review mutation detection compares Git status/diff, not a complete filesystem snapshot.
Redaction implementation and limits (opens in a new tab)
Read-only review options and Git-state guard (opens in a new tab)
Sequential execution, explicit routing, repeatable command checks, and durable evidence make a multi-step agent workflow easier to inspect and continue. Shared Core logic gives CLI and GUI a common execution model.
Operators must maintain task definitions, verification commands, provider installations, routing policy, and stored run artifacts. Review adds another agent invocation and more decisions; shell checks are only as useful as their coverage.
Repeated repository maintenance, modernization steps, or an ordered engineering pipeline where a task needs a known starting point, observable checks, and a reviewable handoff.
A small exploratory edit or a single interactive question may not justify YAML, persistent run history, and a separate review workflow. Provider-independent orchestration also cannot remove provider-specific behavior.
These are architectural trade-offs inferred from the implementation, not measured productivity or cost claims.
UnverifiedSuccess, which is skipped by plain-batch resume and accepted as execution success by the folder layer. Require meaningful checks and review for consequential work.resume --last when none is available; concurrent sessions can make that ambiguous.The public implementation at commit 4b82cba, with configuration and usage examples.
Inspect the normal attempt budget, verification results, saved state, and actual Git commands.
Execution modes, review outcomes, dependency eligibility, and explicit manual actions.
Test source covers retries, no-verification outcomes, resume, routing, confirmation boundaries, manual gates, and rejected review mutations. No fresh AgentBatchRunner test-pass claim is made here.
Evidence reviewed on 22 September 2026 against the public commit above and the matching local source. Unpublished local terminal-classification changes are excluded. No customer deployment, quantified productivity gain, live provider acceptance, or media evidence is claimed.