# Ex-NASA dev reveals his Agentic Engineering Workflow <!-- ref: @content/youtube/david-ondrej/2026-08-07-ex-nasa-dev-agentic-engineering-workflow version: 3 updated_at: 2026-10-31T18:31:01.786Z --> Dex Horthy (David Ondrej, 2026-08-07): Horthy's argument is that agents have become excellent problem solvers without becoming good architects, and the reason is structural: reinforcement learning grades on whether tests pass, and maintainability has no fast oracle to grade against. *Synthesized from Dex Horthy on David Ondrej, 2026-08-07.* Dex Horthy of HumanLayer — who coined "context engineering" in the 12-Factor Agents paper and ran a software factory where agents worked for four months — walks David Ondrej through why he still reads the code. ## Core Thesis Horthy's argument is that agents have become excellent problem solvers without becoming good architects, and the reason is structural: reinforcement learning grades on whether tests pass, and maintainability has no fast oracle to grade against. So the fully hands-off "light software factory," where nobody reads code, eventually strands you in a codebase you stopped understanding months ago with a bug three frontier models can't fix. The alternative is not slower work but earlier work — pulling human judgment forward into product definition, architecture, and what he calls program design, where decisions are still cheap to change and the context window is still small. ## Key Insights - The pre-AI software factory (a concept dating to 1968) is a loop: issue tracker → build → pull request → CI/CD → human review → prod → user complaints and pages at 3am. The first substitution is agent-builds-the-thing, which collapses building from days to minutes while review stays at hours or days. - Design meetings existed as leverage — spend an hour up front so the PR matches what everyone expected and review takes minutes instead of six hours. That logic transfers directly to agents. - With agentic code review, browser testing, and better linters, review speeds up too — but reading the code that matters remains the trust bottleneck once diffs run to tens of thousands of lines. - Incident and support routing closes the loop: alarms and triaged support tickets go straight into the factory, so you wake up to a pull request rather than a page. Ondrej runs a version of this, having a model review every uptime incident and return a diagnosis (provider outage versus missing migration), split across Vercel cron jobs, GitHub Actions, and a small agent loop on render.com. - Even partial automation compounds: one-shotting 30-50% of incidents or work roughly doubles throughput. - **Why the light software factory failed for them.** In July 2025 Horthy's team reviewed plans and tickets but not code. They hit a bug in a shipping desktop app, and because they'd stopped reading months earlier, they spent weeks trudging through sloppy code with angry users. His thesis: the odds of that happening if you stop reading code are higher than the odds models get good enough in time to save you. - Ondrej's amendment — read the *logic*, not necessarily every line: what the first five minutes of onboarding does, what happens on cancellation, what fires on a given endpoint. Horthy's version: know what the product is. - They prototyped, but didn't ship, a feature that quizzes you mid-session on the current state of the codebase and what the new implementation changes, with multiple-choice questions and mermaid diagrams — a check on whether the human is still in charge. - **The four stages.** (1) *Product*: what user problem, and how do we measure it — including running the Amazon move of writing the launch blog post before the feature exists, plus plain HTML mockups of every relevant view. No tech, no schemas. (2) *System architecture*: services, flows, new endpoints, new tables, query outlines — enough that whoever reviews the PR already agrees. (3) *Program design*: the layer most people skip — where files go, type definitions and method signatures in easy-to-scan code blocks, and what the call stack and tests will look like, without implementation detail. (4) *Vertical slices*. - Measurable outcomes are the strongest lever available. If you can point an agent at conversion rate — a number tied to revenue — it can run three variants, read the data daily, and pick a winner. Horthy compares it to auto-research: make this CUDA kernel faster until resource use drops 20%. - Ondrej notes the newest models now test unprompted — swapping a provider and comparing cost, speed, and quality with an LLM judge without being asked, which the previous generation didn't do. - **Why program design must come first**: once thousands of lines exist, you're deep in a context window and already biased toward the model's first choice. Design sessions are context-light — his in-progress example had made the architecture decisions at 43,000 tokens — so you're buying decisions at maximum model intelligence and minimum cost. - **Vertical slices** (Matt Pocock's tracer bullets): models build horizontally, finishing each layer across the codebase, leaving nothing testable until thousands of lines land at the end. Horthy has never seen a model choose the vertical order — mock endpoint, stub front end, wire it down, then migration, business logic, error handling — without being told. Get it working end to end first, then add logic. - Not every situation warrants this. Pre-product-market-fit, where the job is putting many things in front of customers to learn what they'll pay for, it's overkill. From roughly five engineers up — and especially in fintech and public companies where a mistake means a fine — it's step one. - **Why benchmarks don't move him.** SWE-Bench-style problems are one-shot fixes of 100-200 lines graded by whether human-written tests pass. Nothing penalizes slop, so a 99% score tells him the model got better at problem solving, not that he can stop reading code. The characteristic artifacts: JSON.parse wrapped in a catch that logs and rethrows, gratuitous type casts — code written to make a test pass. - The deeper RL problem is the oracle. You can run tests in seconds across millions of loops, but the cost function of bad architecture shows up in weeks and months, which is impossible to backpropagate into a training run. - His second benchmark complaint: real software discovers its problems as it goes, but every benchmark hands the model the whole problem up front. He'd trust a benchmark that delivers a 20-feature roadmap one feature at a time, testing whether the codebase stays easy to change — versus "it cloned Redis in 200,000 lines of Rust," which says nothing about adding a feature in two weeks. - Cognition's newer benchmark moves in the right direction: an LLM judges functional equivalence against a golden human solution rather than exact test shape; a quality judge checks patches against explicit language rules; and — the sharpest idea — the model's own tests are run against the *pre-patch* code, so tests that pass before the fix are exposed as testing nothing. - His unprovable-but-widely-shared intuition: if the model could tell good code from bad, it would write good code in the first place. Review passes with a second frontier model raise the floor and catch small things, but you're using the same models. - Both push toward putting non-code knowledge into the repo. Ondrej writes `/docs/adr` for architecture decision records (pricing decisions, never breaking an API schema and shipping `/v2` instead) and `/docs/external` for things adjacent to the code — which environment variables exist (not their values), payment processor setup, test emails, support channels. - HumanLayer's product keeps plans and design docs as files on disk because read/write/edit/grep/bash is what models are best at, with hooks syncing to the cloud and pulling teammate comments back in. Horthy's rule: fetching context deterministically — a session-start hook that pulls the last 10 Sentry issues — costs CPU, not inference, and saves the model's attention for reasoning. - **Context engineering**, from 12-Factor Agents (March/April 2025, later independently named by Karpathy, Tobi Lütke, and Jeff Huber): everything is tokens in, tokens out, and the only primitive is the context window. Not more tokens — the *right* tokens: nothing wrong, nothing missing, as small as possible. Even encoding matters (XML is more token-efficient than JSON). - The **dumb zone**: around 100,000-120,000 tokens (roughly half the window, in the Opus 4.1/4.5 era) he'd have engineers compact everything into a document and restart from it. He now calls that training wheels — with intuition from ~70 hours of agent work, he regularly runs to 200-300K, and compaction has improved. The midwit peak is rigid token discipline; both ends do what works. - Calvin French-Owen's metaphor for **context anxiety**: a student who paces the first half of an exam, then realizes five minutes remain and starts cutting corners. Opus 4.5 and Sonnet 4.5 visibly did this — scrambling, then giving up — the same degradation tired humans show. - **Bottleneck theory** via Goldratt's *The Goal*: factory managers who maximized each station's utilization piled expensive work-in-progress in front of the real bottleneck. Token-maxing has the same shape — if code review is your bottleneck, more coding agents don't deliver value faster. Ondrej's parallel: work the biggest bottleneck and accept 80% elsewhere. - Horthy's confessed weakness is this exact trap — repeatedly told by bosses across companies to stop making CI faster and ship the tickets. His hardest-won lesson is to zoom out and ask whether the thing making your skin crawl is actually a bottleneck. Both frame it as letting some fires burn: distinguish the gas leak from the embers. - On competing with labs: you're not up against Anthropic, you're up against a product manager at Anthropic — and a small team that genuinely cares can out-execute most teams inside a giant enterprise. Ondrej cites Browser Use beating Anthropic on the same problem within a year or two. - On AI futures, Horthy plans for the middle path — steady improvement at 1.5x or 2x per period — because in the extreme good and extreme bad scenarios nothing you do today matters unless you work on alignment at a lab. He also notes AI polls as deeply unpopular outside the bubble, and that "industrial revolution, life got better" is not a satisfying answer to someone asking whether they'll be able to feed their family. ## Actionable Takeaways 1. Keep reading the code — or at minimum the product logic — even when the agent is doing the writing. Build periodic comprehension checks into your workflow so you notice losing the thread before a bug forces the discovery. 2. Work the four stages in order: product definition with a success metric (write the launch post and HTML mockups first), system architecture, program design (file placement, types, method signatures, call stack, planned tests), then vertical slices. 3. Make design decisions while the session is context-light — tens of thousands of tokens, not hundreds — because re-steering after code exists is far more expensive. 4. Instruct the agent to build end to end first (mock endpoint, stubbed UI, wire it up) and only then add business logic and error handling, so there's something testable at every step. 5. Give agents a measurable target wherever one exists — conversion rate, latency, cost per call — and let them iterate against the number rather than against your description. 6. Route incidents and triaged support requests directly into the agent loop so you receive pull requests instead of pages. 7. Put non-code context into the repository as markdown: `/docs/adr` for architecture decisions, `/docs/external` for environment variable names, payment setup, test accounts, and support channels. 8. Fetch recurring context deterministically with hooks (last N issues at session start) rather than instructing the model to go get it — that's free in inference terms. 9. Discount benchmark scores as evidence about maintainability; when evaluating a model for real work, ask whether the codebase stays changeable after several features, not whether one problem got solved. 10. Before optimizing your agent setup further, identify your actual bottleneck. If it's review, adding coding agents delivers nothing. 11. Match rigor to stage: pre-PMF, move fast and vibe more; past PMF with paying or regulated customers, treat program design as step one. ## Notable Quotes > "Stop playing with your coding agents and get back to work." — Dex Horthy > "There are inefficiencies that are not bottlenecks." — Dex Horthy > "Maintainability has no fast oracle." — Dex Horthy > "The cost function of bad architecture is measured in weeks and months." — Dex Horthy > "If the model knew what good code looked like, then it would be able to write it in the first place." — Dex Horthy > "You're not actually competing against Anthropic, you're competing against a product manager at Anthropic." — Dex Horthy > "If you can tell it a measurable output, the agent will move mountains for you." — David Ondrej --- *You're reading a protocol on [protocol.supply](https://protocol.supply) — hosted, searchable knowledge for AI agents. Think Agent Skills, as an API: bootstrap once (`curl -sL https://api.protocol.supply/bootstrap`), search (`/search?q=…`), fetch (`/@repo/slug`).* *Any skill can become a protocol, and any protocol installs as a local skill — tell your agent "install this as a skill" or see [`@protocol/protocol-to-skill`](https://api.protocol.supply/@protocol/protocol-to-skill).*