How to Stand Up a Work Class
Produces a registered work class with an owner, a demonstrated oracle, stop conditions, and a funded review budget.
A registered work class with an owner, a demonstrated oracle, entry and stop conditions, a funded review budget, and a pilot result that either graduates it or does not.
Any time the organization is about to delegate a category of work rather than an individual task. Section 6 gives the taxonomy and the evidence; this chapter is the procedure for putting one into production.
27.1 The Sequence #
Step 1. Write the class definition. Name, scope boundary, the change shapes it covers, and the change shapes it explicitly does not. A class defined as “refactoring” is not a class. A class defined as “extract-method refactorings within a single module, no public interface change, no dependency change” is one you can build an oracle for.
Step 2. Demonstrate the oracle before anything else. Run Section 24 to completion, including the immutability test where you attempt a write from a test agent and confirm failure. A class without a demonstrated oracle cannot exceed A1, and this is the step organizations skip because the tooling works without it.
Step 3. Set entry conditions. What must be true of a work item before an agent may be dispatched against it. Typically: a complete specification per Section 26, a change-size bound, a path restriction, and a repository whose test suite passes at head. Entry conditions are enforced at dispatch, not documented in a wiki.
Step 4. Choose guards for the known failure mode. Every class has one, and it is usually published. Section 27.3 gives four worked examples. A guard is an automated check specific to the way this class goes wrong, and it runs in addition to the oracle.
Step 5. Model the review cost and fund it. Estimate reviewer hours per accepted change, multiply by projected volume, and compare against available senior engineering hours. If the answer exceeds capacity, the class does not launch at that volume. Every published deployment at scale independently discovered that review throughput rather than agent capability is the binding constraint, and one report measured 16.5 review comments per merged agent pull request against 12.4 for human ones.105
Step 6. Define stop conditions that halt. Not alert. Halt. Typical set: merge rate below a floor, revert rate above a ceiling, review backlog beyond N days, oracle modification attempt detected, visible-to-held-out gap beyond threshold, cost per accepted change beyond budget.
Step 7. Pilot with a termination decision scheduled. Two to four weeks, one team, bounded repositories, full instrumentation, and a date on which someone decides to graduate, extend, or kill it. A pilot without a scheduled decision becomes production by default.
Step 8. Set the baseline before you compare. Measure human merge rate, revert rate, and review cost in the same repositories first. Agent performance is meaningless without it: one enterprise report puts agent merge rate at 67.9 percent against 87.1 percent for employees and 79.7 percent for community contributors in the same repository.105 Without that denominator, 67.9 percent reads as either impressive or alarming depending on the reader’s priors.
Step 9. Graduate on evidence, at a named authority. Section 19.4 is the gate. Graduation raises the tier, widens scope, or both, and it requires operating evidence rather than absence of complaint.
27.2 Setting Expectations Before the Pilot #
Two variables explain more outcome variance than tool choice, and both are knowable in advance. Set expectations from them or the pilot will be read as a verdict on the tool.
Language. One enterprise test-generation system reports viable-test rates of roughly 80 percent for Python, 40 percent for Go, and 20 percent for Java, on the same tool in the same monorepo.123 Security pass rates for generated code show the same shape at 62 percent for Python against 29 percent for Java.15
Codebase age. Greenfield beats brownfield measurably, at 77.3 percent against 67.9 percent in one organization, and an independent evaluation of an autonomous agent scored zero for four on modifying existing projects.105,122
Write the expected range into the pilot plan before it runs. A Java brownfield pilot that lands at 45 percent is performing about as the evidence predicts; the same number in a Python greenfield repository is a problem.
27.3 Guards by Class #
| Class | Known failure mode | Guard |
|---|---|---|
| Test generation | Tests that pass but detect nothing | Mutation-score floor on the generated suite, not a coverage floor.170 |
| Flaky-test repair | The flake disappears because assertions were removed | Assertion-count delta must be zero or positive; semantic diff on the test body; mutation check that the repaired test still kills its original mutant. The rejection analysis of a deployed system names altered test semantics and removed assertions among rejected fixes.161 |
| Dependency upgrade | Model-chosen version carries a known CVE | Versions resolved by policy against a vulnerability database rather than accepted as specified; 36.7 to 55.7 percent of tasks in one study carried a known CVE in the model-specified version.64 |
| Security remediation | The alert closes without the vulnerability being fixed | Independent verification by something other than the alert: a functional test plus a security test the fixing agent never saw. The best vendor benchmark still fails roughly one in six on secure-and-functional first try, and an independent user study found 75 percent of proposed fixes unsuitable to apply as-is.163,164 |
| Migration | Semantic drift the suite does not catch | Differential comparison against the pre-migration behavior; shard into independently revertible changes rather than one atomic change.167 |
| Documentation | Confidently wrong prose | Executable examples, reference validation, and signature comparison. Absent those, A1 and human review. |
27.4 Worked: Standing Up Flaky-Test Repair #
Definition. Repair of tests identified as flaky by the existing detection pipeline, in Go, within services/*, excluding tests touching payment paths.
Oracle. Reproduction of the flake under repeated execution, then repeated passes after repair, at a defined run count. Independent because the reproduction harness is platform-owned. Immutable because test files are outside agent write scope for everything except the target test, and the target test’s assertion count is checked separately.
Entry conditions. The flake is reproducible by the harness; the test is under fifty lines; the owning team has opted in.
Guards. Assertion count must not decrease. A semantic diff flags any change to assertion expressions for mandatory human review. The repaired test must still fail against a mutant that the original test killed.
Review cost. From the published deployment, plan against roughly 17.7 percent end-to-end yield: of 1,115 reported flaky tests, 71.6 percent reproduced, fixes were produced for 47.6 percent of those, and 51.8 percent of generated fixes were accepted and landed.161 Budget review against the fixes produced, not the fixes accepted. A team planning against 51.8 percent will under-provision review by roughly a factor of three.
Stop conditions. Acceptance below 35 percent over two weeks. Any assertion-removal guard trip. Reviewer backlog above five working days.
Pilot. Four weeks, one team, decision date on the calendar, baseline measured first.
27.5 Instrumentation #
- Merge, revert, and defect-escape rate by class, against the per-language and per-repository baseline from step 8
- Declared review cost against measured review hours
- Guard trip rate by guard, with every trip reviewed
- Cost per accepted change
- Classes throttled or tier-reduced on evidence in the trailing year, where zero indicates a register rather than a control
27.6 Failure Signatures #
- The class that has never been throttled. It will saturate review eventually. A register in which nothing has ever been reduced is a list.
- Acceptance rate quoted as yield. The single most common planning error in this literature. Plan the funnel.
- Pilot without a baseline. Produces a number nobody can interpret, and the interpretation defaults to whoever is most invested.
- Guards deferred to phase two. The failure mode each guard addresses is published in advance. Launching without them is choosing to discover a known problem in production.
27.7 What This Rests On #
The review-cost constraint, the language and codebase-age effects, the per-class failure modes, and the flaky-test funnel are all measured.105,123,15,122,170,161,64,163,164,167 The nine-step sequence and the pilot structure are this framework’s construction.
References cited in this section
10 of 243 · numbering matches the PDF
- 105Stephen Toub, "Ten Months with Copilot Coding Agent in dotnet/runtime," .NET Blog, March 23, 2026. Vendor-adjacent — Microsoft reporting on a Microsoft product — but fully denominated and unusually candid.
- 123M. Rastenis, B. Chou, S. Roy Choudhary, and R. Just, "Automated Software Test Generation at Industry Scale Using a Multi-Agent Architecture and Workflow Integration" (AutoCover), ICSE-SEIP '26, DOI 10.1145/3786583.3786918.doi.org/10.1145/3786583.3786918 ↗
- 15Veracode, "Spring 2026 GenAI Code Security Update: Despite Claims, AI Models Are Still Failing Security," March 24, 2026.www.veracode.com/blog/spring-2026-genai-code-security ↗
- 122Hamel Husain, Isaac Flath, and Johno Whitaker, "Thoughts On A Month With Devin," Answer.AI, January 8, 2025. 20 tasks; small-n practitioner evaluation.
- 170Christopher Foster, Rahul Gulati, Mark Harman, Inna Harper, Ke Mao, Jillian Ritchey, Hervé Robert, and Shubho Sengupta, "Mutation-Guided LLM-based Test Generation at Meta" (ACH), FSE Companion '25, arXiv:2501.12862. The 34-point acceptance spread between two teams on the same tool is the finding worth carrying.arxiv.org/abs/2501.12862. ↗
- 161Chengpeng Li, Farnaz Behrang, August Shi, and Peng Liu, "FlakyGuard: Automatically Fixing Flaky Tests at Industry Scale," ASE 2025, arXiv:2511.14002. Peer-reviewed; deployed autonomously at Uber over six months. The 17.7% end-to-end figure is derived from the paper's three reported conditional rates, not stated by the authors; plan against it rather than against the 51.8% acceptance rate.arxiv.org/abs/2511.14002. ↗
- 64Chengjie Wang, Jingzheng Wu, Xiang Ling, Tianyue Luo, and Chen Zhao, "Correct Code, Vulnerable Dependencies: A Large Scale Measurement Study of LLM-Specified Library Versions," arXiv:2605.06279, May 7, 2026. Preprint.arxiv.org/abs/2605.06279 ↗
- 163Snyk, "Benchmarking Secure-and-Functional Remediation," August 18, 2026. Vendor-published; ~150 samples, three languages, single-file scope, two runs — the vendor states the sample is too small for significance on narrow gaps.
- 164Benjamin Steenhoek, Siva Sivaraman, Renata Saldivar Gonzalez, Yevhen Mohylevskyy, Roshanak Zilouchian Moghaddam, and Wei Le, "Closing the Gap: A User Study on the Real-World Usefulness of AI-powered Vulnerability Detection & Repair in the IDE," arXiv:2412.14306. 17 professional developers, 24 projects, >1.7M lines; conducted with Microsoft.arxiv.org/abs/2412.14306. ↗
- 167Hyrum Wright, "Large-Scale Changes," chapter 22 in Software Engineering at Google (Sebastopol, CA: O'Reilly, 2020). Predates AI by a decade; its shard-and-land architecture has not been re-validated for agentic work.