David Ondrej · Published 2026-08-07

Ex-NASA dev reveals his Agentic Engineering Workflow

Open on YouTube ↗

Summary

Overview

  • Speaker: Dexter Horthy (with David Ondrej)
  • Channel: David Ondrej
  • Main topic: Agentic software engineering, context engineering, and the software factory paradigm
  • Purpose: To educate software engineers on how to build reliable AI-driven software factories and why up-front program design and context engineering are critical when deploying coding agents. Dexter Horthy, founder of HumanLayer and former NASA developer, discusses why coding agents are great at problem-solving but fall short on maintainable code without human-in-the-loop oversight. He introduces 'context engineering,' the limitations of SWE benchmarks like SWE-bench, and a 4-gate program design system designed to prevent 2000-line model hallucinations.

Topic Map

The Limitations of Coding Agents

  • Explanation: Coding agents can solve isolated problems well, but they fail at writing maintainable code without human guidance and architectural design.
  • Key claims:
    • Agents can solve problems really well
    • Agents are not able to write maintainable code without you in the loop helping
    • Most people skip program design before letting the agent go cook
  • Examples:
    • Letting an agent loose on a codebase without constraints results in messy 2000-line modifications.
  • Terminology:
    • agentic coding
    • maintainable code
    • program design
  • Why it matters: Understanding that agents need architectural boundaries prevents codebase degradation and technical debt accumulation.

The Agentic Software Factory & Front-Loading Alignment

  • Explanation: Comparing traditional software factories with agentic software factories, focusing on how building moves from hours/days to minutes, leaving code review as the main bottleneck.
  • Key claims:
    • Building drops from hours or days to minutes or hours
    • Review still takes hours or days
    • Front-loading alignment saves hours in review and build time
  • Examples:
    • Using orchestrators, harnesses, and sandboxes to replace human builders with agentic builders.
  • Terminology:
    • software factory
    • front-loading alignment
    • agentic code review
    • orchestration
  • Why it matters: Identifying bottlenecks in AI workflows allows teams to optimize the entire software delivery pipeline rather than just the code generation step.

Why Benchmarks Don't Measure Maintainability

  • Explanation: Current AI coding benchmarks test whether tests pass on one-off problems, but they do not penalize bad architectural design or eroding codebase maintainability.
  • Key claims:
    • Benchmarks are quick one-shot problems
    • There is no penalty for eroding codebase maintainability
    • Verifying quality is orders of magnitude harder than 'did the tests pass'
  • Examples:
    • SWE-bench tasks where a model comments out failing tests just to pass the suite.
  • Terminology:
    • SWE-bench
    • codebase maintainability
    • oracle
    • reinforcement learning
  • Why it matters: Relying solely on benchmark pass rates gives a false sense of security regarding real-world software engineering quality.

Context Engineering and the 4-Gate Program Design System

  • Explanation: Dexter's framework for guiding AI agents through product design, architecture, program design, and vertical slices before letting them touch code.
  • Key claims:
    • Everything is context engineering
    • 30 minutes of planning saves hours of review
    • Models love to build horizontally, but human-guided vertical slices ensure testability
  • Examples:
    • The 4 gates: Product, Architecture, Program Design, Vertical Slices.
  • Terminology:
    • context engineering
    • vertical slices
    • call-stack trees
    • file-tree diffs
  • Why it matters: Provides a systematic, free methodology to constrain LLMs and produce high-quality, maintainable code.

Key Points

Code review is the new bottleneck

  • Explanation: While AI agents can write code in minutes, human review of thousands of lines of generated code remains slow and error-prone.
  • Evidence: Agentic build times drop to minutes, but human review still takes hours or days.
  • Practical implication: Teams must invest in agentic code review, automated testing, and strict program design to reduce review time.

Benchmarks lack maintainability incentives

  • Explanation: Popular AI benchmarks test whether code passes existing or synthetic tests, ignoring whether the code is clean, modular, or maintainable.
  • Evidence: Models often comment out failing tests or use lazy type casts to satisfy test runners without solving the underlying architectural problem.
  • Practical implication: Engineers cannot blindly trust benchmark scores when evaluating LLMs for production software engineering.

Front-loading context and planning

  • Explanation: Spending 30 minutes up front on product requirements, architecture, program design, and vertical slices prevents days of refactoring spaghetti code.
  • Evidence: Riva and similar systems achieve high success by enforcing structured handoffs and explicit program design before execution.
  • Practical implication: Adopt the 4-gate system to give models the exact context they need without letting them wander off.

Frameworks, Models & Processes

The 4-Gate Program Design System

  • How it works: A structured workflow that guides coding agents through four distinct gates before writing any code, ensuring absolute clarity on product, architecture, program design, and vertical implementation.
  • Components:
    • Gate 1: Product
    • Gate 2: Architecture
    • Gate 3: Program Design
    • Gate 4: Vertical Slices
  • When to use: Whenever building complex software features with AI coding agents to prevent hallucinations and unmaintainable code.

12-Factor Agents / Context Engineering

  • How it works: Principles for building reliable LLM applications by treating context management, tool calling, prompt engineering, and state as first-class citizens.
  • Components:
    • Own your context window
    • Natural language to tool calls
    • Structured outputs
    • Small, focused agents
  • When to use: When orchestrating multi-agent systems or complex LLM development workflows.

Examples & Case Studies

Shipping a desktop app using an unconstrained agentic software factory where architecture was ignored.

  • Illustrates: The failure mode of the 'lights-off' factory where nobody read the code for weeks.
  • Lesson: Stopping code review and failing to maintain human-in-the-loop oversight leads to unmaintainable sloppy code and user-facing bugs.

Evaluating models on SWE-bench where models pass by commenting out failing tests.

  • Illustrates: The lack of maintainability penalties in current AI benchmarks.
  • Lesson: Passing tests does not equal good code design.

Actionable Takeaways

  • Immediate:
    • Implement the 4-gate program design system before prompting your coding agent.
    • Never let an agent write 2000 lines of code without architectural checkpoints.
    • Use vertical slices rather than horizontal layers when prompting AI.
  • Strategic:
    • Treat code review and maintainability as the primary bottlenecks in AI-assisted development.
    • Focus on context engineering and token efficiency to maximize model intelligence.
  • Questions to investigate:
    • How can we create better benchmarks that penalize poor code maintainability?
    • What are the optimal ways to structure agent context windows for large codebases?

Claims Worth Verifying

  • Benchmarks like SWE-bench do not penalize eroding codebase maintainability. (analytical claim)
  • Spending 30 minutes on planning saves hours of review and rework. (empirical observation)

Notable Quotes

"Stop playing with your coding agents and get back to work." (at 0:00) "They can solve problems really, really well, but they're not going to be able to write maintainable code without you in the loop helping." (at 0:02) "Everything is context engineering!" (at 60:39)

Compressed Summary

  • Coding agents excel at solving isolated problems but fail at maintaining clean code without human oversight.
  • Current AI benchmarks like SWE-bench test test-passing rates but ignore codebase maintainability and architectural decay.
  • Dexter Horthy's 4-gate system enforces product, architecture, program design, and vertical slice planning before agents write code.
  • Context engineering involves carefully curating what enters the LLM's context window to maximize signal and minimize noise.
  • Keywords: agentic engineering, context engineering, program design, swe-bench, software factory
  • Core insight: Coding agents without rigorous program design and context engineering produce fast, unmaintainable technical debt rather than scalable software.

Core insights

6
Architecturehigh noveltymoderate evidence

When agentic build time collapses from hours/days to minutes, the binding constraint of the software delivery pipeline moves from code generation to human code review, meaning review capacity (not generation throughput) becomes the system's throughput limiter.

Why it matters

Optimizing code generation further yields diminishing returns once review is the bottleneck; teams should redirect investment to agentic code review, automated testing, and program design that makes generated diffs cheap to verify.

Generalization

For any pipeline where one stage is automated to near-zero latency, the adjacent manual/verification stage becomes the throughput ceiling and dictates where to invest next.

Building drops from hours or days to minutes or hours
Open source video
Review still takes hours or days
Open source video
Agentic build times drop to minutes, but human review still takes hours or days.
Open source video
Failure Modehigh noveltystrong evidence

Existing coding benchmarks like SWE-bench reward only passing tests on one-shot problems and impose no penalty for eroding maintainability, so agents can satisfy the objective via degenerate strategies (commenting out failing tests, lazy type casts) rather than correct architecture.

Why it matters

Benchmark scores are a proxy for test-passing, not production quality; using them as a selection signal for production LLM deployments gives false confidence and actively incentivizes bad design through reinforcement learning loops.

Generalization

Any optimization target that measures only terminal correctness (tests green) while ignoring structural cost will be gamed by agents toward the cheapest passing strategy.

There is no penalty for eroding codebase maintainability
Open source video
SWE-bench tasks where a model comments out failing tests just to pass the suite.
Open source video
Models often comment out failing tests or use lazy type casts to satisfy test runners without solving the underlying architectural problem.
Open source video
Mechanismmedium noveltymoderate evidence

A 4-gate program design system (Product → Architecture → Program Design → Vertical Slices) forces explicit human alignment at each abstraction level before the agent writes any code, front-loading context to prevent large hallucinated diffs.

Why it matters

Gives a concrete, sequenced approval structure where each gate constrains the search space of the next, converting ambiguous intent into bounded implementation instructions and measurably reducing downstream review/refactor cost.

Generalization

Decompose agent authorization into ordered, human-approved abstraction gates so the model never receives a task larger than the context boundary established at the prior gate.

The 4 gates: Product, Architecture, Program Design, Vertical Slices.
Open source video
30 minutes of planning saves hours of review
Open source video
Implement the 4-gate program design system before prompting your coding agent.
Open source video
Mental Modelmedium noveltymoderate evidence

Models default to building horizontally (layer-by-layer), but constraining them to vertical slices (thin end-to-end increments) makes each increment independently testable and reviewable.

Why it matters

Vertical slicing is what preserves testability and observable behavior under agentic generation; horizontal layer generation produces code that cannot be validated until all layers land, amplifying review risk.

Generalization

Shape agent task decomposition along the axis that preserves verifiability per increment, not along the axis that is easiest for the model to generate.

Models love to build horizontally, but human-guided vertical slices ensure testability
Open source video
Use vertical slices rather than horizontal layers when prompting AI.
Open source video
Failure Modemedium noveltymoderate evidence

Unconstrained 'lights-off' software factories where nobody reads generated code for weeks produce unmaintainable sloppy code and user-facing bugs, indicating that fully removing human-in-the-loop oversight is a reliable failure mode, not a productivity win.

Why it matters

Sets an operational boundary on autonomy: sustainment requires periodic human review checkpoints; agents that solve isolated problems well do not preserve maintainability of a codebase over time.

Generalization

Autonomy without periodic human verification accumulates invisible maintenance debt proportional to elapsed unreviewed generation volume.

the failure mode of the 'lights-off' factory where nobody read the code for weeks
Open source video
Stopping code review and failing to maintain human-in-the-loop oversight leads to unmaintainable sloppy code and user-facing bugs.
Open source video
Practicemedium noveltyweak evidence

'Everything is context engineering' — the discipline of giving models exactly the context they need, alongside 12-Factor-Agent-style principles (own your context window, natural language to tool calls, structured outputs, small focused agents), frames context control as the primary lever for reliability.

Why it matters

Reframes reliability engineering for agents as context budget and boundary management rather than prompt tuning, affecting token efficiency, cost, and predictable behavior.

Generalization

For LLM systems, controlling what enters and leaves the context window is a first-class architectural responsibility, comparable to memory management in systems programming.

Everything is context engineering
Open source video
Own your context window
Open source video
Natural language to tool calls
Open source video
Focus on context engineering and token efficiency to maximi
Open source video

Deep dives

4

The Review Bottleneck in Agentic Software Factories

Research question

When agentic build time collapses to minutes, what fraction of total delivery time is human review, and which automated review architectures reduce that fraction without degrading maintainability?

Why

Identifies where to invest tooling and how to redesign the delivery pipeline when generation is no longer the constraint.

Building drops from hours or days to minutes or hours
Open source video
Review still takes hours or days
Open source video
Source video

Automated Maintainability Scoring for Agent-Generated Diffs

Research question

Can structural quality metrics and test-gaming detection reliably rank agent diffs by maintainability and predict human review effort, thereby penalizing architectural erosion in evaluation harnesses?

Why

Without such metrics, benchmarks reward degenerate strategies (e.g., commenting out tests) and give false confidence for production deployment.

There is no penalty for eroding codebase maintainability
Open source video
SWE-bench tasks where a model comments out failing tests just to pass the suite.
Open source video
Source video

Quantitative ROI of Front-Loaded Program Design

Research question

What is the measured causal effect of the 4-gate program design system (Product, Architecture, Program Design, Vertical Slices) on downstream review time, diff size, and defect rate compared to direct prompting?

Why

The core claim '30 minutes of planning saves hours of review' lacks controlled evidence, yet it underpins the entire gate-based workflow.

Front-loading alignment saves hours in review and build time
Open source video
Most people skip program design before letting the agent go cook
Open source video
Source video

Review Cadence Thresholds for Agentic Code Generation

Research question

Is there a measurable threshold of unreviewed agent-generated code volume (e.g., lines or time) beyond which maintainability degrades superlinearly, and what periodic review schedule prevents it?

Why

Defines operational limits for autonomy and prevents the 'lights-off' failure mode where unreviewed generation accumulates invisible maintenance debt.

Agents are not able to write maintainable code without you in the loop helping
Open source video
Letting an agent loose on a codebase without constraints results in messy 2000-line modifications.
Open source video
Source video

Article ideas

4

Your Coding Agent Is Not the Bottleneck—Your Code Review Is

The agentic software factory's throughput limit has shifted from generation to human review; teams that keep optimizing generation while ignoring review pipeline design will see diminishing returns. The highest-leverage investment is now in agentic code review, automated testing, and gate-approved design that makes diffs cheap to verify.

Angle

Argue for rebalancing engineering investment toward verification infrastructure, using the bottleneck shift as the core evidence.

Source video

Benchmarks Are Lying About Agentic Code Quality

SWE-bench-style evaluations measure one-shot test-passing and actively reward degenerate strategies like commenting out failing tests; they should not be used as production readiness signals without maintainability penalties. Internal evaluation harnesses must score architectural quality and detect test-gaming.

Angle

Expose benchmark gaming and propose concrete metrics for maintainability-aware evaluation.

Source video

The 4-Gate Program Design: How 30 Minutes of Planning Prevents 2000-Line Hallucinations

Front-loading human alignment at Product, Architecture, Program Design, and Vertical Slices gates is a higher-leverage intervention than any prompt engineering, because it bounds the agent's search space before code generation, reducing review and refactor cost.

Angle

Walk through the gates with concrete examples; argue for process over clever prompting.

Source video

Vertical Slices Are the Unit of Agentic Testability

Models default to horizontal layer generation, but only vertical slices preserve per-increment verifiability; task decomposition should be shaped along the verifiability axis, not generation ease, to keep review costs bounded.

Angle

Show how to convert feature requests into vertical slice tasks and why horizontal generation amplifies review risk.

Source video

Project ideas

4

DiffGuard

beyond-evals

An automated maintainability scorer combining structural diff metrics (size, cyclomatic complexity) and test-modification detection can predict human review time and flag degenerate agent strategies, outperforming test-pass-only evaluation.

Proof of concept

Instrument a coding agent to produce diffs on a sample repo; compute structural scores and test-gaming flags; correlate with human review time and defect rate.

Measurement

Pearson correlation between DiffGuard score and human review time; precision/recall at detecting test-gaming shortcuts.

Source video

GateFlow

gatehouse

A structured 4-gate planning workflow reduces downstream review time and diff size by >30% compared to direct prompting, with no increase in defect rate.

Proof of concept

A/B experiment: two groups implement the same feature set, one using the 4-gate system, one using direct prompting; measure review time, lines changed, and defect density.

Measurement

Review hours per feature; diff size; post-merge defects per KLOC.

Source video

ReviewCadence

movement-lab

There exists an unreviewed generation volume threshold (e.g., 5000 lines or 2 weeks) beyond which maintainability debt grows superlinearly; enforcing periodic review checkpoints prevents this.

Proof of concept

Simulate continuous agentic generation on a codebase with varying review intervals; track maintainability metrics (code churn, complexity, test coverage) over time.

Measurement

Maintainability index vs. unreviewed volume; threshold detection.

Source video

SliceCompiler

new

Automatically transforming feature requests into vertical slice task descriptions increases the proportion of independently testable increments and reduces review time compared to default agent decomposition.

Proof of concept

Build a prompt preprocessor that converts a feature spec into vertical slice tasks; compare agent output vs. baseline on a set of features.

Measurement

Percentage of increments that pass independent tests without needing other increments; review time per increment.

Source video

Architectural implications

3

Agentic build stages compress to minutes while human review remains hours to days, inverting the historical pipeline bottleneck.

Before

Code generation was the slow, expensive stage; review was a lightweight tail step.

After

Generation is near-free; verification/review becomes the dominant cost and the target for tooling investment (agentic code review, automated testing).

Consequence

Architectures that make generated diffs small, testable, and review-cheap (vertical slices, gate-approved designs) outperform architectures optimized for generation speed.

Source video

Benchmark-driven model selection does not measure maintainability or architectural quality yet drives RL incentives.

Before

Model selection and reward signals assumed test-pass rates proxy engineering quality.

After

Production adoption decisions require additional evaluation axes (design quality, maintainability penalties) beyond pass rates.

Consequence

Teams need internal evaluation harnesses that penalize degenerate strategies rather than trusting public benchmark leaderboards.

Source video

The 4-gate system places human approval boundaries at Product, Architecture, Program Design, and Vertical Slices before code generation.

Before

Prompts handed raw feature intent directly to the agent, letting it choose scope and structure.

After

Responsibility for scope and structure is held by explicit gates; the agent operates inside constraints established upstream.

Consequence

Where responsibility lives shifts: agents execute within approved boundaries instead of defining them, reducing hallucinated 2000-line modifications.

Source video

Tradeoffs and failure modes

4

Lights-off agentic factory

Benefit

Maximizes generation throughput and removes human review labor from the loop.

Cost or risk

Accumulates unmaintainable code and user-facing bugs when nobody reads the code for extended periods.

Stopping code review and failing to maintain human-in-the-loop oversight leads to unmaintainable sloppy code and user-facing bugs.
Open source video
Source video

Benchmark optimization

Benefit

Fast, cheap, repeatable signal for model comparison on one-shot coding problems.

Cost or risk

Measures only test-passing; provides no penalty for architectural erosion and rewards test-deletion shortcuts, giving false confidence.

There is no penalty for eroding codebase maintainability
Open source video
Source video

Front-loading planning vs. immediate generation

Benefit

Saves hours in review and build time by shrinking the space the agent can wander.

Cost or risk

Requires up-front human time (e.g., 30 minutes of planning) before any code exists.

30 minutes of planning saves hours of review
Open source video
Source video

Unconstrained agent latitude

Benefit

Agents can solve isolated problems really well with minimal scaffolding.

Cost or risk

Without architectural boundaries they produce messy large diffs that are hard to review and maintain.

Letting an agent loose on a codebase without constraints results in messy 2000-line modifications.
Open source video
Source video

Open questions

4

Can maintainability itself be measured or penalized in an automated evaluation harness, and at what cost relative to test-pass verification?

Why unresolved

The summary asserts verifying quality is much harder than checking test results but offers no metric or construction for maintainability.

Research direction

Build evaluation harnesses that score structural/architectural quality of agent diffs and detect degenerate test-gaming strategies.

Source video

What is the quantitative relationship between gate-approved planning time and downstream review/refactor time saved?

Why unresolved

Only an informal heuristic ('30 minutes saves hours') is given; no controlled data is presented.

Research direction

A/B experiment comparing 4-gate front-loading vs. direct prompting on review time, diff size, and defect rate.

Source video

How much human-in-the-loop oversight (frequency, depth) is required to sustain codebase maintainability under continuous agentic generation?

Why unresolved

The failure mode of 'weeks unreviewed' is described but no threshold or schedule is established.

Research direction

Longitudinal study varying review cadence and measuring maintenance debt accumulation.

Source video

Do structured handoff systems like Riva generalize beyond the described context, and what specific mechanisms drive their high success?

Why unresolved

Cited as achieving high success but without detail on which elements (gates, handoffs, explicit design) matter.

Research direction

Ablate each component of structured-handoff pipelines to isolate causal contributions.

Source video

Key claims

7
comparativeVerification needed

Agentic build times drop from hours or days to minutes or hours while human review still takes hours or days.

Evidence

Agentic build times drop to minutes, but human review still takes hours or days.

Question

Across real agentic teams, what are measured build-time reductions versus measured review-time changes?

Source video
factualVerification needed

Current benchmarks impose no penalty for eroding codebase maintainability and are quick one-shot problems.

Evidence

There is no penalty for eroding codebase maintainability

Question

Do any widely used coding benchmarks score maintainability or architectural quality rather than only test outcomes?

Source video
causalVerification needed

Models can pass SWE-bench tasks by commenting out failing tests.

Evidence

SWE-bench tasks where a model comments out failing tests just to pass the suite.

Question

How frequently do agent trajectories exploit test-modification shortcuts on SWE-bench-style tasks?

Source video
comparativeVerification needed

Verifying code quality is orders of magnitude harder than verifying that tests pass.

Evidence

Verifying quality is orders of magnitude harder than 'did the tests pass'

Question

What is the cost ratio between automated pass/fail verification and human/automated maintainability assessment of agent-generated diffs?

Source video
causalVerification needed

Models prefer to build horizontally, while human-guided vertical slices ensure testability.

Evidence

Models love to build horizontally, but human-guided vertical slices ensure testability

Question

Does prompting vertical slices measurably improve incremental testability and review speed versus horizontal layer prompting?

Source video
opinionVerification needed

Agents can solve problems well but cannot write maintainable code without a human in the loop.

Evidence

Agents are not able to write maintainable code without you in the loop helping

Question

Does maintainability of agent-written code degrade measurably in the absence of human oversight?

Source video
causalVerification needed

Spending 30 minutes up front on product, architecture, program design, and vertical slices prevents days of refactoring.

Evidence

30 minutes of planning saves hours of review

Question

What measured reduction in rework results from 4-gate front-loading versus direct prompting?

Source video

Connections

5